[mythtv] [PATCH] MythMusic Ogg Vorbis Metadata (was:Re:
[mythtv-commits] mythtv commits)
Denys Dmytriyenko
denis at denix.org
Tue Jun 8 00:14:55 EDT 2004
Hi,
I am sorry to tell you this, but the patch below by Tony Lill for Ogg
Vorbis was wrong. Here is what it does:
$ cvs diff -u10 -r 1.10 -r 1.11 vorbisdecoder.cpp
Index: vorbisdecoder.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/vorbisdecoder.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -1 -0 -r1.10 -r1.11
--- vorbisdecoder.cpp 10 May 2004 22:48:37 -0000 1.10
+++ vorbisdecoder.cpp 25 May 2004 04:22:56 -0000 1.11
@@ -338,21 +338,21 @@
if (ov_open(input, &vf, NULL, 0))
{
fclose(input);
return NULL;
}
comment = ov_comment(&vf, -1);
length = (int)ov_time_total(&vf, -1) * 1000;
- if (ignore_id3)
+ if (ignore_id3 || title.isEmpty())
{
getMetadataFromFilename(filename, QString(".ogg$"), artist, album,
title, genre, tracknum);
}
else
{
artist = getComment(comment, "artist");
album = getComment(comment, "album");
title = getComment(comment, "title");
genre = getComment(comment, "genre");
===================================================================
As you can see, it checks for variable "title" being empty, but it is
not assigned yet, which makes it always get the metadata from filename
instead of the real "ID3 tag".
Attached is probably a better way of doing this.
mythtv at cvs.mythtv.org wrote:
> ----------------------------------------------------------------------------
> Changes committed by thor on Tue May 25 04:22:56 2004
>
> Modified Files:
> in mythmusic/mythmusic:
> avfdecoder.cpp flacdecoder.cpp maddecoder.cpp
> vorbisdecoder.cpp
> Log Message:
>
> Tony Lill's patch to get metadata from filenames if the id3 tag for the
> track's title is empty.
>
>
>
> ----------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mythtv-commits mailing list
> mythtv-commits at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-commits
-------------- next part --------------
Index: vorbisdecoder.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/vorbisdecoder.cpp,v
retrieving revision 1.11
diff -u -r1.11 vorbisdecoder.cpp
--- vorbisdecoder.cpp 25 May 2004 04:22:56 -0000 1.11
+++ vorbisdecoder.cpp 8 Jun 2004 04:07:31 -0000
@@ -345,7 +345,7 @@
comment = ov_comment(&vf, -1);
length = (int)ov_time_total(&vf, -1) * 1000;
- if (ignore_id3 || title.isEmpty())
+ if (ignore_id3)
{
getMetadataFromFilename(filename, QString(".ogg$"), artist, album,
title, genre, tracknum);
@@ -359,6 +359,11 @@
tracknum = atoi(getComment(comment, "tracknumber").ascii());
year = atoi(getComment(comment, "date").ascii());
}
+ if (title.isEmpty())
+ {
+ getMetadataFromFilename(filename, QString(".ogg$"), artist, album,
+ title, genre, tracknum);
+ }
ov_clear(&vf);
More information about the mythtv-dev
mailing list