Skip to content

Commit

Permalink
update channel_layout by channels, for ffmpeg transcode opus to aac s…
Browse files Browse the repository at this point in the history
…uccess (#2452)
  • Loading branch information
Haibo Chen authored Jun 30, 2021
1 parent 9f5d011 commit d32d8c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trunk/src/app/srs_app_rtc_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_) {
Expand Down

0 comments on commit d32d8c0

Please sign in to comment.