style: ffmpeg format code

This commit is contained in:
xiaoyifang 2022-12-05 09:56:45 +08:00
parent 2fc4af11a8
commit 20410f50e7

View file

@ -240,14 +240,13 @@ bool DecoderContext::openCodec( QString & errorString )
codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) ); codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
auto layout = codecContext_->channel_layout; auto layout = codecContext_->channel_layout;
if(!layout) if( !layout )
{ {
layout=av_get_default_channel_layout( codecContext_->channels ); layout = av_get_default_channel_layout( codecContext_->channels );
codecContext_->channel_layout = layout; codecContext_->channel_layout = layout;
} }
swr_ = swr_alloc_set_opts( swr_ = swr_alloc_set_opts( NULL,
NULL,
layout, layout,
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
44100, 44100,