Commit 22b16e6a authored by Michael Niedermayer's avatar Michael Niedermayer

Factorize ic->streams[i] out,

change from ffmbc

Originally committed as revision 20852 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b3e88ae8
...@@ -2921,7 +2921,8 @@ static void opt_input_file(const char *filename) ...@@ -2921,7 +2921,8 @@ static void opt_input_file(const char *filename)
/* update the current parameters so that they match the one of the input stream */ /* update the current parameters so that they match the one of the input stream */
for(i=0;i<ic->nb_streams;i++) { for(i=0;i<ic->nb_streams;i++) {
AVCodecContext *enc = ic->streams[i]->codec; AVStream *st = ic->streams[i];
AVCodecContext *enc = st->codec;
if(thread_count>1) if(thread_count>1)
avcodec_thread_init(enc, thread_count); avcodec_thread_init(enc, thread_count);
enc->thread_count= thread_count; enc->thread_count= thread_count;
...@@ -2935,7 +2936,7 @@ static void opt_input_file(const char *filename) ...@@ -2935,7 +2936,7 @@ static void opt_input_file(const char *filename)
audio_sample_fmt = enc->sample_fmt; audio_sample_fmt = enc->sample_fmt;
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(audio_codec_name); input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(audio_codec_name);
if(audio_disable) if(audio_disable)
ic->streams[i]->discard= AVDISCARD_ALL; st->discard= AVDISCARD_ALL;
break; break;
case CODEC_TYPE_VIDEO: case CODEC_TYPE_VIDEO:
set_context_opts(enc, avcodec_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM); set_context_opts(enc, avcodec_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
...@@ -2971,16 +2972,16 @@ static void opt_input_file(const char *filename) ...@@ -2971,16 +2972,16 @@ static void opt_input_file(const char *filename)
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(video_codec_name); input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(video_codec_name);
if(video_disable) if(video_disable)
ic->streams[i]->discard= AVDISCARD_ALL; st->discard= AVDISCARD_ALL;
else if(video_discard) else if(video_discard)
ic->streams[i]->discard= video_discard; st->discard= video_discard;
break; break;
case CODEC_TYPE_DATA: case CODEC_TYPE_DATA:
break; break;
case CODEC_TYPE_SUBTITLE: case CODEC_TYPE_SUBTITLE:
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(subtitle_codec_name); input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(subtitle_codec_name);
if(subtitle_disable) if(subtitle_disable)
ic->streams[i]->discard = AVDISCARD_ALL; st->discard = AVDISCARD_ALL;
break; break;
case CODEC_TYPE_ATTACHMENT: case CODEC_TYPE_ATTACHMENT:
case CODEC_TYPE_UNKNOWN: case CODEC_TYPE_UNKNOWN:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment