From ad9419fa7d3d16a25dfff88a4b78cd075f827a92 Mon Sep 17 00:00:00 2001 From: TheM14 Date: Sat, 14 Nov 2026 03:36:51 +0800 Subject: [PATCH] Resume native PCM draining after input EOF process_pcm saved the EOF frame and enabled draining, then returned without emitting output or marking filter progress. Reading the input pin does not schedule another process call, so the queued PCM was left stranded with the output request still pending. On Android this stalled the 10-second WAV at 00:06 and the full FLAC at 04:38 / 05:05. Mark filter progress after storing EOF so the next process call runs the existing gradual drain and forwards EOF after the remaining audio. Keep the input-duration limit, renderer flush and decoder routing intact. Verified with native Windows builds: the WAV outputs 480000 samples and the FLAC outputs 14647040 samples at 48 kHz, both reaching EOF. The FLAC baseline stalls at 278.528 seconds. E-AC-3 JOC output is bit-identical, and ad-joc-pcm=no still selects the default decoder. Android baseline failures were reproduced; the patched APK has not been built or tested. --- fork/files/audio/decode/ad_joc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fork/files/audio/decode/ad_joc.c b/fork/files/audio/decode/ad_joc.c index 0641298..68c504c 100644 --- a/fork/files/audio/decode/ad_joc.c +++ b/fork/files/audio/decode/ad_joc.c @@ -625,6 +625,9 @@ static void process_pcm(struct mp_filter *f) } p->eof_frame = in; p->eof_pending = true; + /* Reading EOF does not schedule us again. No further input will + * arrive, so explicitly resume the drain with output still requested. */ + mp_filter_internal_mark_progress(f); return; } if (in.type != MP_FRAME_PACKET) {