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