[MPlayer-dev-eng] [PATCH] Equals in Ogg comments

Nicolas George nicolas.george at ens.fr
Mon Mar 5 10:50:02 CET 2007


[ Note: this is a repost: I already posted almost the same message a little
more than a week ago, but with the flame on the SVN repository <tiny>and me
having forgotten the [PATCH] tag</tiny> it got forgotten. The original file
has not changed in the repository. ]

Hi.

The parsing of Ogg comments in demux_ogg.c has a small bug. I have some Ogg
files with tags such as:

	title=Ashitaka Sekki
	album=Mononoke Hime
	album_ja=もののけ 姫
	artist=Joe Hisaishi
	artist_ja=久石 譲
	title_en=The Tale of Ashitaka
	title_ja=アシタカせっき
	tracknumber=1

When I play them with mplayer, I got:

Clip info:
 Name: ja=アシタカせっき
 Album: ja=もののけ 姫
 Artist: ja=久石 譲
 Track: 1

While it should be:

Clip info:
 Name: Ashitaka Sekki
 Album: Mononoke Hime
 Artist: Joe Hisaishi
 Track: 1

Note especially the "ja=" in the tag value.

Here is a trivial patch that checks the '=' sign. It may be cleaner to store
the result of strlen in a local variable, but since it will be computed at
compile time, it does not matter much.

Regards,

-- 
  Nicolas George
-------------- next part --------------
Index: libmpdemux/demux_ogg.c
===================================================================
--- libmpdemux/demux_ogg.c	(revision 22335)
+++ libmpdemux/demux_ogg.c	(working copy)
@@ -455,7 +455,8 @@
     else {
 	for (i = 0; table[i].ogg; i++)
 	{
-	    if (!strncasecmp(*cmt, table[i].ogg, strlen(table[i].ogg)))
+	    if (!strncasecmp(*cmt, table[i].ogg, strlen(table[i].ogg)) &&
+		(*cmt)[strlen(table[i].ogg)] == '=')
 	    {
 		hdr = table[i].mp;
 		val = *cmt + strlen(table[i].ogg) + 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070305/6f1cb2e1/attachment.pgp>


More information about the MPlayer-dev-eng mailing list