Fixes for ffmpeg api changes/bugs.
authorNot Zed <notzed@gmail.com>
Mon, 8 Jan 2024 03:24:45 +0000 (13:54 +1030)
committerNot Zed <notzed@gmail.com>
Mon, 8 Jan 2024 03:24:45 +0000 (13:54 +1030)
music-player.c

index ce09607..e1e678b 100644 (file)
@@ -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)