update channel_layout by channels, for ffmpeg transcode opus to aac success (#2452)

pull/2461/head
Haibo Chen 4 years ago committed by GitHub
parent 9f5d011687
commit d32d8c0da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -148,6 +148,8 @@ srs_error_t SrsAudioTranscoder::init_dec(SrsAudioCodecId src_codec)
return srs_error_new(ERROR_RTC_RTP_MUXER, "Could not open codec");
}
dec_->channel_layout = av_get_default_channel_layout(dec_->channels);
dec_frame_ = av_frame_alloc();
if (!dec_frame_) {
return srs_error_new(ERROR_RTC_RTP_MUXER, "Could not allocate audio decode out frame");

Loading…
Cancel
Save