[FFmpeg-cvslog] r22473 - in trunk/libavformat: flacdec.c oggdec.h oggparseflac.c oggparsespeex.c oggparsetheora.c oggparsevorbis.c

conrad subversion
Fri Mar 12 06:16:44 CET 2010


Author: conrad
Date: Fri Mar 12 06:16:44 2010
New Revision: 22473

Log:
oggdec: Metadata is per-stream; don't merge multiple streams' together

Modified:
   trunk/libavformat/flacdec.c
   trunk/libavformat/oggdec.h
   trunk/libavformat/oggparseflac.c
   trunk/libavformat/oggparsespeex.c
   trunk/libavformat/oggparsetheora.c
   trunk/libavformat/oggparsevorbis.c

Modified: trunk/libavformat/flacdec.c
==============================================================================
--- trunk/libavformat/flacdec.c	Fri Mar 12 06:16:39 2010	(r22472)
+++ trunk/libavformat/flacdec.c	Fri Mar 12 06:16:44 2010	(r22473)
@@ -113,7 +113,7 @@ static int flac_read_header(AVFormatCont
             }
             /* process supported blocks other than STREAMINFO */
             if (metadata_type == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
-                if (ff_vorbis_comment(s, buffer, metadata_size)) {
+                if (ff_vorbis_comment(s, &s->metadata, buffer, metadata_size)) {
                     av_log(s, AV_LOG_WARNING, "error parsing VorbisComment metadata\n");
                 }
             }

Modified: trunk/libavformat/oggdec.h
==============================================================================
--- trunk/libavformat/oggdec.h	Fri Mar 12 06:16:39 2010	(r22472)
+++ trunk/libavformat/oggdec.h	Fri Mar 12 06:16:44 2010	(r22473)
@@ -115,7 +115,7 @@ extern const struct ogg_codec ff_vorbis_
 
 extern const AVMetadataConv ff_vorbiscomment_metadata_conv[];
 
-int ff_vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size);
+int ff_vorbis_comment(AVFormatContext *ms, AVMetadata **m, uint8_t *buf, int size);
 
 static inline int
 ogg_find_stream (struct ogg * ogg, int serial)

Modified: trunk/libavformat/oggparseflac.c
==============================================================================
--- trunk/libavformat/oggparseflac.c	Fri Mar 12 06:16:39 2010	(r22472)
+++ trunk/libavformat/oggparseflac.c	Fri Mar 12 06:16:44 2010	(r22473)
@@ -68,7 +68,7 @@ flac_header (AVFormatContext * s, int id
         st->time_base.num = 1;
         st->time_base.den = st->codec->sample_rate;
     } else if (mdt == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
-        ff_vorbis_comment (s, os->buf + os->pstart + 4, os->psize - 4);
+        ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 4, os->psize - 4);
     }
 
     return 1;

Modified: trunk/libavformat/oggparsespeex.c
==============================================================================
--- trunk/libavformat/oggparsespeex.c	Fri Mar 12 06:16:39 2010	(r22472)
+++ trunk/libavformat/oggparsespeex.c	Fri Mar 12 06:16:44 2010	(r22473)
@@ -75,7 +75,7 @@ static int speex_header(AVFormatContext 
         st->time_base.num = 1;
         st->time_base.den = st->codec->sample_rate;
     } else
-        ff_vorbis_comment(s, p, os->psize);
+        ff_vorbis_comment(s, &st->metadata, p, os->psize);
 
     spxp->seq++;
     return 1;

Modified: trunk/libavformat/oggparsetheora.c
==============================================================================
--- trunk/libavformat/oggparsetheora.c	Fri Mar 12 06:16:39 2010	(r22472)
+++ trunk/libavformat/oggparsetheora.c	Fri Mar 12 06:16:44 2010	(r22473)
@@ -109,7 +109,7 @@ theora_header (AVFormatContext * s, int 
         st->need_parsing = AVSTREAM_PARSE_HEADERS;
 
     } else if (os->buf[os->pstart] == 0x83) {
-        ff_vorbis_comment (s, os->buf + os->pstart + 7, os->psize - 8);
+        ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8);
     }
 
     st->codec->extradata = av_realloc (st->codec->extradata,

Modified: trunk/libavformat/oggparsevorbis.c
==============================================================================
--- trunk/libavformat/oggparsevorbis.c	Fri Mar 12 06:16:39 2010	(r22472)
+++ trunk/libavformat/oggparsevorbis.c	Fri Mar 12 06:16:44 2010	(r22473)
@@ -42,7 +42,7 @@ const AVMetadataConv ff_vorbiscomment_me
 };
 
 int
-ff_vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
+ff_vorbis_comment(AVFormatContext * as, AVMetadata **m, uint8_t *buf, int size)
 {
     const uint8_t *p = buf;
     const uint8_t *end = buf + size;
@@ -101,7 +101,7 @@ ff_vorbis_comment(AVFormatContext * as, 
             memcpy(ct, v, vl);
             ct[vl] = 0;
 
-            av_metadata_set2(&as->metadata, tt, ct,
+            av_metadata_set2(m, tt, ct,
                                    AV_METADATA_DONT_STRDUP_KEY |
                                    AV_METADATA_DONT_STRDUP_VAL);
         }
@@ -220,7 +220,7 @@ vorbis_header (AVFormatContext * s, int 
         st->time_base.den = st->codec->sample_rate;
     } else if (os->buf[os->pstart] == 3) {
         if (os->psize > 8)
-            ff_vorbis_comment (s, os->buf + os->pstart + 7, os->psize - 8);
+            ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8);
     } else {
         st->codec->extradata_size =
             fixup_vorbis_headers(s, priv, &st->codec->extradata);



More information about the ffmpeg-cvslog mailing list