libsaria: Properly set the inode for each track tag

I was setting local variables rather than the TrackTag variable.  No
wonder things didn't work
This commit is contained in:
Bryan Schumaker 2011-11-06 13:09:59 -05:00
parent 5b2e0c7b82
commit b3cb20dd5d
1 changed files with 4 additions and 6 deletions

View File

@ -15,6 +15,7 @@ TrackTag::TrackTag()
TrackTag::TrackTag(const TrackTag &tag) TrackTag::TrackTag(const TrackTag &tag)
{ {
inode = tag.inode;
filepath = tag.filepath; filepath = tag.filepath;
title = tag.title; title = tag.title;
artist = tag.artist; artist = tag.artist;
@ -28,10 +29,9 @@ TrackTag::TrackTag(const TrackTag &tag)
bitrate = tag.bitrate; bitrate = tag.bitrate;
sample = tag.sample; sample = tag.sample;
channels = tag.channels; channels = tag.channels;
inode = tag.inode;
} }
TrackTag::TrackTag(string file, ino_t inode) TrackTag::TrackTag(string file, ino_t ino)
{ {
Tag *tag; Tag *tag;
AudioProperties *prop; AudioProperties *prop;
@ -40,6 +40,7 @@ TrackTag::TrackTag(string file, ino_t inode)
if (ref.isNull()) if (ref.isNull())
throw "Error tagging file: " + file; throw "Error tagging file: " + file;
filepath = file; filepath = file;
inode = ino;
/* Extract tags */ /* Extract tags */
tag = ref.tag(); tag = ref.tag();
@ -58,8 +59,6 @@ TrackTag::TrackTag(string file, ino_t inode)
sample = prop->sampleRate(); sample = prop->sampleRate();
channels = prop->channels(); channels = prop->channels();
inode = inode;
make_lenstr(); make_lenstr();
} }
@ -79,7 +78,6 @@ TrackTag::TrackTag(InFile &in)
bitrate = in.read_int(); bitrate = in.read_int();
sample = in.read_int(); sample = in.read_int();
channels = in.read_int(); channels = in.read_int();
inode = inode;
} }
TrackTag::~TrackTag() TrackTag::~TrackTag()
@ -88,7 +86,7 @@ TrackTag::~TrackTag()
void TrackTag::save(OutFile &out) void TrackTag::save(OutFile &out)
{ {
out.write_lui(inode, false); out.write_ino(inode, false);
out.write_str(filepath, false); out.write_str(filepath, false);
out.write_str(title, false); out.write_str(title, false);
out.write_str(artist, false); out.write_str(artist, false);