Skip to content

Commit

Permalink
Merge pull request #125 from CatmanIX/master
Browse files Browse the repository at this point in the history
ffmpeg5 fix for issue #122
  • Loading branch information
lalinsky authored Dec 17, 2022
2 parents b6d5f13 + 82781d0 commit aa67c95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/audio/ffmpeg_audio_processor_swresample.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FFmpegAudioProcessor {
}

void SetInputChannelLayout(AVChannelLayout *channel_layout) {
av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
av_opt_set_chlayout(m_swr_ctx, "in_chlayout", channel_layout, 0);
}

void SetInputSampleFormat(AVSampleFormat sample_format) {
Expand All @@ -41,7 +41,7 @@ class FFmpegAudioProcessor {
}

void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
av_opt_set_chlayout(m_swr_ctx, "out_chlayout", channel_layout, 0);
}

void SetOutputSampleFormat(AVSampleFormat sample_format) {
Expand Down
5 changes: 3 additions & 2 deletions src/audio/ffmpeg_audio_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,10 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
} else {
m_has_more_frames = false;
}
} else {
SetError("Error decoding the audio source", ret);
return false;
}
SetError("Error decoding the audio source", ret);
return false;
}

if (m_frame->nb_samples > 0) {
Expand Down

0 comments on commit aa67c95

Please sign in to comment.