aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-08-04 16:03:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-08-04 16:03:39 +0000
commit365515ac7f04a31afb1bbb7f9e1a7292bacb7605 (patch)
tree163637a55037a143bfb3e403e3cc1735114b856b
parent5e61de0cc1020737aeb7e774ba7a9f06aba7d918 (diff)
downloadffmpeg-365515ac7f04a31afb1bbb7f9e1a7292bacb7605.tar.gz
be slightly more careful with copying the codec_tag in the streamcopy case
fixes streamcopy of Xmen-avc-500.vp6 into flv closes issue 57 Originally committed as revision 9909 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 66d21010de..7fc17fe720 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1503,6 +1503,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++) {
ost = ost_table[i];
+ os = output_files[ost->file_index];
ist = ist_table[ost->source_index];
codec = ost->st->codec;
@@ -1516,7 +1517,14 @@ static int av_encode(AVFormatContext **output_files,
/* if stream_copy is selected, no need to decode or encode */
codec->codec_id = icodec->codec_id;
codec->codec_type = icodec->codec_type;
- if(!codec->codec_tag) codec->codec_tag = icodec->codec_tag;
+
+ if(!codec->codec_tag){
+ if( !os->oformat->codec_tag
+ || av_codec_get_id (os->oformat->codec_tag, icodec->codec_tag) > 0
+ || av_codec_get_tag(os->oformat->codec_tag, icodec->codec_id) <= 0)
+ codec->codec_tag = icodec->codec_tag;
+ }
+
codec->bit_rate = icodec->bit_rate;
codec->extradata= icodec->extradata;
codec->extradata_size= icodec->extradata_size;