media: hold the AV1 startup clock on decoder backpressure

Keep the MP4 hardware startup clock steady while its first picture waits for input or decoder capacity. Advancing it on each retry made the core discard the first picture to catch up. Preserve normal pacing once a display slot has advanced, and assert the first presented slot after decoder, output and sink backpressure.
This commit is contained in:
Codex committed 2026-10-21 05:25:52 +02:00
1 parent 052282cf71
commit e4d20c791d
2 files changed
+10

No files matched your search

+4
View File
@@ -2161,8 +2161,12 @@ void MEDIA_CORE_PREFIX(retro_run)(void)
== RMP4_VIDEO_WAIT_DECODER
|| (p->dt && !data_transfer_complete(p->dt)
&& !data_transfer_failed(p->dt))))
{
/* Hold the picture until input or decoder capacity returns. */
if (p->mp4_hw_required && !p->vshown)
p->play_ns -= p->frame_ns;
break;
}
if (r != 1)
{
p->eof = 1;
@@ -9,6 +9,7 @@ static unsigned taken, stopped, ticks, ready, sink_busy, decode_busy,
static video_hw_frame_t held, retry;
static const char *fixture_path;
static unsigned container;
static unsigned first_display;
static uint64_t pcm_frames, pcm_nonzero;
static uint32_t pcm_hash;
#define CHECK(c) \
@@ -132,6 +133,8 @@ static bool sink(void *user, const video_hw_frame_t *frame)
if (held.image)
video_hw_frame_abandon(&held);
held = *frame;
if (!first_display)
first_display = (unsigned)media_player.vshown;
taken++;
return true;
}
@@ -258,6 +261,7 @@ static void test_container(void)
}
rav1_set_hw_backend(&backend);
ready = 1;
first_display = 0;
decode_busy = output_busy = sink_busy = 2;
for (i = 0; i < 32 && !stopped; i++)
{
@@ -268,6 +272,8 @@ static void test_container(void)
CHECK(accepted == decoded);
}
CHECK(stopped && taken && ticks && !media_player.hw_frame.image);
if (!container)
CHECK(first_display == 1);
unload();
before = taken;
if (!load())