From 55bc4331908c8c8ae8f6a374dd1e03ef9a555846 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 8 Jan 2024 13:54:45 +1030 Subject: [PATCH] Fixes for ffmpeg api changes/bugs. --- music-player.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/music-player.c b/music-player.c index ce09607..e1e678b 100644 --- a/music-player.c +++ b/music-player.c @@ -418,7 +418,7 @@ static int audio_init_filter(struct audio_player *ap) { char layout[32]; res = av_channel_layout_describe(&avctx->ch_layout, layout, sizeof(layout)); - sprintf(tmp, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%s", + sprintf(tmp, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=%s", time_base.num, time_base.den, avctx->sample_rate, av_get_sample_fmt_name(avctx->sample_fmt), layout); @@ -433,9 +433,8 @@ static int audio_init_filter(struct audio_player *ap) { goto fail; } - sprintf(tmp, "sample_fmts=%s:sample_rates=%d:channel_layouts=0x%lx", - av_get_sample_fmt_name(AV_SAMPLE_FMT_S16), ap->sample_rate, - (uint64_t)AV_CH_LAYOUT_STEREO); + sprintf(tmp, "sample_fmts=%s:sample_rates=%d:channel_layouts=stereo", + av_get_sample_fmt_name(AV_SAMPLE_FMT_S16), ap->sample_rate); fprintf(stderr, "aformat: %s\n", tmp); res = avfilter_graph_create_filter(&ap->aformat_ctx, aformat, "format", tmp, NULL, ap->fg); if (res < 0) -- 2.39.5