[FFmpeg-devel] [PATCH] id3v2: read TXXX frames
Michael Niedermayer
michaelni
Mon Sep 28 11:01:46 CEST 2009
On Sat, Sep 26, 2009 at 02:48:16PM +0200, Anton Khirnov wrote:
> i've replaced this patch with a better one, which now reads all text
> information frames and exports them with correct tag names.
[...]
> @@ -134,19 +135,26 @@ static void read_ttag(AVFormatContext *s, int taglen, const char *key)
> av_log(s, AV_LOG_WARNING, "Unknown encoding in tag %s\n.", key);
> }
>
> - if (!strcmp(key, "genre")
> + if (!(strcmp(key, "TCON") && strcmp(key, "TCO"))
> && (sscanf(dst, "(%d)", &genre) == 1 || sscanf(dst, "%d", &genre) == 1)
> && genre <= ID3v1_GENRE_MAX)
> - av_strlcpy(dst, ff_id3v1_genre_str[genre], sizeof(dst));
> + val = ff_id3v1_genre_str[genre];
> + else if (!strcmp(key, "TXXX")) { /*dst now contains two 0-terminated strings*/
> + dst[dstlen] = 0;
> + key = dst;
> + val = dst + FFMIN(dstlen - 1, strlen(dst)) + 1;
FFMIN(dstlen, strlen(dst) + 1);
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090928/d473e05f/attachment.pgp>
More information about the ffmpeg-devel
mailing list