@ -321,24 +321,12 @@ FF_DISABLE_DEPRECATION_WARNINGS
avctx - > channels = avctx - > ch_layout . nb_channels ;
avctx - > channels = avctx - > ch_layout . nb_channels ;
avctx - > channel_layout = avctx - > ch_layout . order = = AV_CHANNEL_ORDER_NATIVE ?
avctx - > channel_layout = avctx - > ch_layout . order = = AV_CHANNEL_ORDER_NATIVE ?
avctx - > ch_layout . u . mask : 0 ;
avctx - > ch_layout . u . mask : 0 ;
FF_ENABLE_DEPRECATION_WARNINGS
# endif
/* validate channel layout from the decoder */
/* validate channel layout from the decoder */
if ( avctx - > channel_layout ) {
if ( ( avctx - > ch_layout . nb_channels & & ! av_channel_layout_check ( & avctx - > ch_layout ) ) | |
int channels = av_get_channel_layout_nb_channels ( avctx - > channel_layout ) ;
avctx - > ch_layout . nb_channels > FF_SANE_NB_CHANNELS ) {
if ( ! avctx - > channels )
avctx - > channels = channels ;
else if ( channels ! = avctx - > channels ) {
char buf [ 512 ] ;
av_get_channel_layout_string ( buf , sizeof ( buf ) , - 1 , avctx - > channel_layout ) ;
av_log ( avctx , AV_LOG_WARNING ,
" Channel layout '%s' with %d channels does not match specified number of channels %d: "
" ignoring specified channel layout \n " ,
buf , channels , avctx - > channels ) ;
avctx - > channel_layout = 0 ;
}
}
if ( avctx - > channels & & avctx - > channels < 0 | |
avctx - > channels > FF_SANE_NB_CHANNELS ) {
ret = AVERROR ( EINVAL ) ;
ret = AVERROR ( EINVAL ) ;
goto free_and_end ;
goto free_and_end ;
}
}
@ -346,8 +334,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
ret = AVERROR ( EINVAL ) ;
ret = AVERROR ( EINVAL ) ;
goto free_and_end ;
goto free_and_end ;
}
}
FF_ENABLE_DEPRECATION_WARNINGS
# endif
# if FF_API_AVCTX_TIMEBASE
# if FF_API_AVCTX_TIMEBASE
if ( avctx - > framerate . num > 0 & & avctx - > framerate . den > 0 )
if ( avctx - > framerate . num > 0 & & avctx - > framerate . den > 0 )