|
|
|
@ -137,8 +137,6 @@ static int64_t get_bit_rate(AVCodecContext *ctx) |
|
|
|
|
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) |
|
|
|
|
{ |
|
|
|
|
int ret = 0; |
|
|
|
|
int orig_channels; |
|
|
|
|
uint64_t orig_channel_layout; |
|
|
|
|
AVCodecInternal *avci; |
|
|
|
|
|
|
|
|
|
if (avcodec_is_open(avctx)) |
|
|
|
@ -275,14 +273,6 @@ FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
avctx->ch_layout.nb_channels = avctx->channels; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* temporary compat wrapper for new-style callers and old-style codecs;
|
|
|
|
|
* to be removed once all the codecs have been converted */ |
|
|
|
|
if (avctx->ch_layout.nb_channels) { |
|
|
|
|
avctx->channels = avctx->ch_layout.nb_channels; |
|
|
|
|
avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? |
|
|
|
|
avctx->ch_layout.u.mask : 0; |
|
|
|
|
} |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -346,13 +336,6 @@ FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
if (!HAVE_THREADS && !(codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS)) |
|
|
|
|
avctx->thread_count = 1; |
|
|
|
|
|
|
|
|
|
#if FF_API_OLD_CHANNEL_LAYOUT |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
orig_channels = avctx->channels; |
|
|
|
|
orig_channel_layout = avctx->channel_layout; |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (!(avctx->active_thread_type & FF_THREAD_FRAME) || |
|
|
|
|
avci->frame_thread_encoder) { |
|
|
|
|
if (avctx->codec->init) { |
|
|
|
@ -375,18 +358,6 @@ FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
|
|
|
|
|
#if FF_API_OLD_CHANNEL_LAYOUT |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
/* decoder setting the old-style fields */ |
|
|
|
|
if (avctx->channels != orig_channels || |
|
|
|
|
avctx->channel_layout != orig_channel_layout) { |
|
|
|
|
av_channel_layout_uninit(&avctx->ch_layout); |
|
|
|
|
if (avctx->channel_layout) { |
|
|
|
|
av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout); |
|
|
|
|
} else { |
|
|
|
|
avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; |
|
|
|
|
avctx->ch_layout.nb_channels = avctx->channels; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* update the deprecated fields for old-style callers */ |
|
|
|
|
avctx->channels = avctx->ch_layout.nb_channels; |
|
|
|
|
avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? |
|
|
|
|