From: Not Zed Date: Mon, 8 Jan 2024 03:24:45 +0000 (+1030) Subject: Fixes for ffmpeg api changes/bugs. X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=55bc4331908c8c8ae8f6a374dd1e03ef9a555846;p=playerz Fixes for ffmpeg api changes/bugs. --- 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)