aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2010-03-01 07:22:59 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2010-03-01 07:22:59 +0000
commitc71591a5096514c2b0198c16d82bfd703b03c184 (patch)
tree4664ce1f05ed1a053cadbe6afd7bfbfbac8d4118 /ffmpeg.c
parentbc9973768904049469b1ccb9b1da4ce2c54c8fac (diff)
downloadffmpeg-c71591a5096514c2b0198c16d82bfd703b03c184.tar.gz
ffmpeg: copy stream metadata.
Patch by Anton Khirnov wyskasgmailcom Originally committed as revision 22126 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index fe250f8b06..8c0bdd9f67 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1837,7 +1837,7 @@ static int av_encode(AVFormatContext **output_files,
/* for each output stream, we compute the right encoding parameters */
for(i=0;i<nb_ostreams;i++) {
- AVMetadataTag *lang;
+ AVMetadataTag *t = NULL, *lang = NULL;
ost = ost_table[i];
os = output_files[ost->file_index];
ist = ist_table[ost->source_index];
@@ -1845,9 +1845,13 @@ static int av_encode(AVFormatContext **output_files,
codec = ost->st->codec;
icodec = ist->st->codec;
- if ((lang=av_metadata_get(ist->st->metadata, "language", NULL, 0))
- && !av_metadata_get(ost->st->metadata, "language", NULL, 0))
- av_metadata_set(&ost->st->metadata, "language", lang->value);
+ if (av_metadata_get(ist->st->metadata, "language", NULL, 0))
+ lang = av_metadata_get(ost->st->metadata, "language", NULL, 0);
+ while ((t = av_metadata_get(ist->st->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) {
+ if (lang && !strcmp(t->key, "language"))
+ continue;
+ av_metadata_set2(&ost->st->metadata, t->key, t->value, NULL);
+ }
ost->st->disposition = ist->st->disposition;
codec->bits_per_raw_sample= icodec->bits_per_raw_sample;