diff options
author | James Almer <jamrial@gmail.com> | 2013-07-18 04:18:24 -0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-28 21:10:51 +0200 |
commit | ac8e70d7358ed6d319b5eac21cbeea223ed9d1c9 (patch) | |
tree | 6c8598423d5ffecc74ec6f01eb16bd3b9e0bb305 | |
parent | 7651c0e49b1f6e66120ef32570a87e3f09224574 (diff) | |
download | ffmpeg-ac8e70d7358ed6d319b5eac21cbeea223ed9d1c9.tar.gz |
oggenc: Write stream metadata if available
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/oggenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 1255364259..3135de6776 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) |