[FFmpeg-cvslog] oggenc: Write stream metadata if available

James Almer git at videolan.org
Sun Jul 28 22:00:48 CEST 2013


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Jul 18 04:18:24 2013 -0300| [ac8e70d7358ed6d319b5eac21cbeea223ed9d1c9] | committer: Michael Niedermayer

oggenc: Write stream metadata if available

Signed-off-by: James Almer <jamrial at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac8e70d7358ed6d319b5eac21cbeea223ed9d1c9
---

 libavformat/oggenc.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 1255364..3135de6 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -447,11 +447,13 @@ static int ogg_write_header(AVFormatContext *s)
             } while (j < i);
         oggstream->serial_num = serial_num;
 
+        av_dict_copy(&st->metadata, s->metadata, AV_DICT_DONT_OVERWRITE);
+
         st->priv_data = oggstream;
         if (st->codec->codec_id == AV_CODEC_ID_FLAC) {
             int err = ogg_build_flac_headers(st->codec, oggstream,
                                              st->codec->flags & CODEC_FLAG_BITEXACT,
-                                             &s->metadata);
+                                             &st->metadata);
             if (err) {
                 av_log(s, AV_LOG_ERROR, "Error writing FLAC headers\n");
                 av_freep(&st->priv_data);
@@ -460,7 +462,7 @@ static int ogg_write_header(AVFormatContext *s)
         } else if (st->codec->codec_id == AV_CODEC_ID_SPEEX) {
             int err = ogg_build_speex_headers(st->codec, oggstream,
                                               st->codec->flags & CODEC_FLAG_BITEXACT,
-                                              &s->metadata);
+                                              &st->metadata);
             if (err) {
                 av_log(s, AV_LOG_ERROR, "Error writing Speex headers\n");
                 av_freep(&st->priv_data);
@@ -469,7 +471,7 @@ static int ogg_write_header(AVFormatContext *s)
         } else if (st->codec->codec_id == AV_CODEC_ID_OPUS) {
             int err = ogg_build_opus_headers(st->codec, oggstream,
                                              st->codec->flags & CODEC_FLAG_BITEXACT,
-                                             &s->metadata);
+                                             &st->metadata);
             if (err) {
                 av_log(s, AV_LOG_ERROR, "Error writing Opus headers\n");
                 av_freep(&st->priv_data);
@@ -490,7 +492,7 @@ static int ogg_write_header(AVFormatContext *s)
             }
 
             p = ogg_write_vorbiscomment(7, st->codec->flags & CODEC_FLAG_BITEXACT,
-                                        &oggstream->header_len[1], &s->metadata,
+                                        &oggstream->header_len[1], &st->metadata,
                                         framing_bit);
             oggstream->header[1] = p;
             if (!p)



More information about the ffmpeg-cvslog mailing list