The variable refer to a *decoder* context, the old name was
misleading.
Originally committed as revision 24492 to svn://svn.ffmpeg.org/ffmpeg/trunk
... | ... |
@@ -3230,45 +3230,45 @@ static void opt_input_file(const char *filename) |
3230 | 3230 |
/* update the current parameters so that they match the one of the input stream */ |
3231 | 3231 |
for(i=0;i<ic->nb_streams;i++) { |
3232 | 3232 |
AVStream *st = ic->streams[i]; |
3233 |
- AVCodecContext *enc = st->codec; |
|
3234 |
- avcodec_thread_init(enc, thread_count); |
|
3235 |
- switch(enc->codec_type) { |
|
3233 |
+ AVCodecContext *dec = st->codec; |
|
3234 |
+ avcodec_thread_init(dec, thread_count); |
|
3235 |
+ switch (dec->codec_type) { |
|
3236 | 3236 |
case AVMEDIA_TYPE_AUDIO: |
3237 |
- set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM); |
|
3238 |
- //fprintf(stderr, "\nInput Audio channels: %d", enc->channels); |
|
3239 |
- channel_layout = enc->channel_layout; |
|
3240 |
- audio_channels = enc->channels; |
|
3241 |
- audio_sample_rate = enc->sample_rate; |
|
3242 |
- audio_sample_fmt = enc->sample_fmt; |
|
3237 |
+ set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM); |
|
3238 |
+ //fprintf(stderr, "\nInput Audio channels: %d", dec->channels); |
|
3239 |
+ channel_layout = dec->channel_layout; |
|
3240 |
+ audio_channels = dec->channels; |
|
3241 |
+ audio_sample_rate = dec->sample_rate; |
|
3242 |
+ audio_sample_fmt = dec->sample_fmt; |
|
3243 | 3243 |
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(audio_codec_name); |
3244 | 3244 |
if(audio_disable) |
3245 | 3245 |
st->discard= AVDISCARD_ALL; |
3246 | 3246 |
break; |
3247 | 3247 |
case AVMEDIA_TYPE_VIDEO: |
3248 |
- set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM); |
|
3249 |
- frame_height = enc->height; |
|
3250 |
- frame_width = enc->width; |
|
3248 |
+ set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM); |
|
3249 |
+ frame_height = dec->height; |
|
3250 |
+ frame_width = dec->width; |
|
3251 | 3251 |
if(ic->streams[i]->sample_aspect_ratio.num) |
3252 | 3252 |
frame_aspect_ratio=av_q2d(ic->streams[i]->sample_aspect_ratio); |
3253 | 3253 |
else |
3254 |
- frame_aspect_ratio=av_q2d(enc->sample_aspect_ratio); |
|
3255 |
- frame_aspect_ratio *= (float) enc->width / enc->height; |
|
3256 |
- frame_pix_fmt = enc->pix_fmt; |
|
3254 |
+ frame_aspect_ratio=av_q2d(dec->sample_aspect_ratio); |
|
3255 |
+ frame_aspect_ratio *= (float) dec->width / dec->height; |
|
3256 |
+ frame_pix_fmt = dec->pix_fmt; |
|
3257 | 3257 |
rfps = ic->streams[i]->r_frame_rate.num; |
3258 | 3258 |
rfps_base = ic->streams[i]->r_frame_rate.den; |
3259 |
- if(enc->lowres) { |
|
3260 |
- enc->flags |= CODEC_FLAG_EMU_EDGE; |
|
3261 |
- frame_height >>= enc->lowres; |
|
3262 |
- frame_width >>= enc->lowres; |
|
3259 |
+ if (dec->lowres) { |
|
3260 |
+ dec->flags |= CODEC_FLAG_EMU_EDGE; |
|
3261 |
+ frame_height >>= dec->lowres; |
|
3262 |
+ frame_width >>= dec->lowres; |
|
3263 | 3263 |
} |
3264 | 3264 |
if(me_threshold) |
3265 |
- enc->debug |= FF_DEBUG_MV; |
|
3265 |
+ dec->debug |= FF_DEBUG_MV; |
|
3266 | 3266 |
|
3267 |
- if (enc->time_base.den != rfps*enc->ticks_per_frame || enc->time_base.num != rfps_base) { |
|
3267 |
+ if (dec->time_base.den != rfps*dec->ticks_per_frame || dec->time_base.num != rfps_base) { |
|
3268 | 3268 |
|
3269 | 3269 |
if (verbose >= 0) |
3270 | 3270 |
fprintf(stderr,"\nSeems stream %d codec frame rate differs from container frame rate: %2.2f (%d/%d) -> %2.2f (%d/%d)\n", |
3271 |
- i, (float)enc->time_base.den / enc->time_base.num, enc->time_base.den, enc->time_base.num, |
|
3271 |
+ i, (float)dec->time_base.den / dec->time_base.num, dec->time_base.den, dec->time_base.num, |
|
3272 | 3272 |
|
3273 | 3273 |
(float)rfps / rfps_base, rfps, rfps_base); |
3274 | 3274 |
} |