mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Simplify writing stream metadata.
Patch by Anton Khirnov <wyskas gmail com>. Originally committed as revision 22809 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
1a6498d78c
commit
46e6fb4c54
8
ffmpeg.c
8
ffmpeg.c
@ -1914,7 +1914,7 @@ static int av_transcode(AVFormatContext **output_files,
|
|||||||
|
|
||||||
/* for each output stream, we compute the right encoding parameters */
|
/* for each output stream, we compute the right encoding parameters */
|
||||||
for(i=0;i<nb_ostreams;i++) {
|
for(i=0;i<nb_ostreams;i++) {
|
||||||
AVMetadataTag *t = NULL, *lang = NULL;
|
AVMetadataTag *t = NULL;
|
||||||
ost = ost_table[i];
|
ost = ost_table[i];
|
||||||
os = output_files[ost->file_index];
|
os = output_files[ost->file_index];
|
||||||
ist = ist_table[ost->source_index];
|
ist = ist_table[ost->source_index];
|
||||||
@ -1922,12 +1922,8 @@ static int av_transcode(AVFormatContext **output_files,
|
|||||||
codec = ost->st->codec;
|
codec = ost->st->codec;
|
||||||
icodec = ist->st->codec;
|
icodec = ist->st->codec;
|
||||||
|
|
||||||
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))) {
|
while ((t = av_metadata_get(ist->st->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) {
|
||||||
if (lang && !strcmp(t->key, "language"))
|
av_metadata_set2(&ost->st->metadata, t->key, t->value, AV_METADATA_DONT_OVERWRITE);
|
||||||
continue;
|
|
||||||
av_metadata_set2(&ost->st->metadata, t->key, t->value, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ost->st->disposition = ist->st->disposition;
|
ost->st->disposition = ist->st->disposition;
|
||||||
|
Loading…
Reference in New Issue
Block a user