History

Simplify writing stream metadata.

Patch by Anton Khirnov <wyskas gmail com>. Originally committed as revision 22809 to svn://svn.ffmpeg.org/ffmpeg/trunk

Anton Khirnov committed 16 years ago

Commit 46e6fb41 parent 1a6498d1 file · +2 −6Browse files

Unified · Split

ffmpeg.c+2−6
@@ -1914,7 +1914,7 @@ static int av_transcode(AVFormatContext **output_files, · 1913 unmodified lines
1914 1914
1915 /* for each output stream, we compute the right encoding parameters */1915 /* for each output stream, we compute the right encoding parameters */
1916 for(i=0;i<nb_ostreams;i++) {1916 for(i=0;i<nb_ostreams;i++) {
1917 AVMetadataTag *t = NULL, *lang = NULL;1917 AVMetadataTag *t = NULL;
1918 ost = ost_table[i];1918 ost = ost_table[i];
1919 os = output_files[ost->file_index];1919 os = output_files[ost->file_index];
1920 ist = ist_table[ost->source_index];1920 ist = ist_table[ost->source_index];
@@ -1922,12 +1922,8 @@ static int av_transcode(AVFormatContext **output_files, · 1 unmodified line
1922 codec = ost->st->codec;1922 codec = ost->st->codec;
1923 icodec = ist->st->codec;1923 icodec = ist->st->codec;
1924 1924
1925 if (av_metadata_get(ist->st->metadata, "language", NULL, 0))
1926 lang = av_metadata_get(ost->st->metadata, "language", NULL, 0);
1927 while ((t = av_metadata_get(ist->st->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) {1925 while ((t = av_metadata_get(ist->st->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) {
1928 if (lang && !strcmp(t->key, "language"))1926 av_metadata_set2(&ost->st->metadata, t->key, t->value, AV_METADATA_DONT_OVERWRITE);
1929 continue;
1930 av_metadata_set2(&ost->st->metadata, t->key, t->value, 0);
1931 }1927 }
1932 1928
1933 ost->st->disposition = ist->st->disposition;1929 ost->st->disposition = ist->st->disposition;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t