1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00

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

This commit is contained in:
Haibo Chen 2021-07-01 06:22:16 +08:00 committed by GitHub
parent 9f5d011687
commit d32d8c0da6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,6 +147,8 @@ srs_error_t SrsAudioTranscoder::init_dec(SrsAudioCodecId src_codec)
if (avcodec_open2(dec_, codec, NULL) < 0) {
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_) {