mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-06 06:50:43 +09:00
Fix audio (swr) for ffmpeg 4.4
This commit is contained in:
@@ -2381,8 +2381,13 @@ int main(int argc, char **argv) {
|
|||||||
fprintf(stderr, "Failed to create SwrContext\n");
|
fprintf(stderr, "Failed to create SwrContext\n");
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
av_opt_set_int(swr, "in_channel_layout", AV_CH_LAYOUT_STEREO, 0);
|
#if LIBAVUTIL_VERSION_MAJOR <= 56
|
||||||
av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
|
av_opt_set_channel_layout(swr, "in_channel_layout", AV_CH_LAYOUT_STEREO, 0);
|
||||||
|
av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
|
||||||
|
#else
|
||||||
|
av_opt_set_chlayout(swr, "in_channel_layout", &audio_track.codec_context->ch_layout, 0);
|
||||||
|
av_opt_set_chlayout(swr, "out_channel_layout", &audio_track.codec_context->ch_layout, 0);
|
||||||
|
#endif
|
||||||
av_opt_set_int(swr, "in_sample_rate", audio_track.codec_context->sample_rate, 0);
|
av_opt_set_int(swr, "in_sample_rate", audio_track.codec_context->sample_rate, 0);
|
||||||
av_opt_set_int(swr, "out_sample_rate", audio_track.codec_context->sample_rate, 0);
|
av_opt_set_int(swr, "out_sample_rate", audio_track.codec_context->sample_rate, 0);
|
||||||
av_opt_set_sample_fmt(swr, "in_sample_fmt", sound_device_sample_format, 0);
|
av_opt_set_sample_fmt(swr, "in_sample_fmt", sound_device_sample_format, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user