Skip to content

[3.x] es_out: fix flapping PREROLL flag on non dated packets

Marvin Scholz requested to merge ePirat/vlc:epirat-3.0.x-fix-preroll into 3.0.x

Saves pts to perform preroll target comparison against. refs #25129 (closed)

In some cases, the packets are sent interleaved with non dated packets SEND 1 SEND TS_INVALID (...) multiple times, simplified to 1 occurence PCR 1 SEND 719996 SEND TS_INVALID PCR 719996 SEND 1439992 SEND TS_INVALID PCR 1439992 SEND 2160008 SEND TS_INVALID PCR 2160008

Until preroll_end (file caching) is reached, all packets are flagged as PREROLL.

Entering preroll has effect on audio output by flushing previous content, and silencing dropped buffers.

Due to non dated interleaving, the stateless es_out keeps flipping PREROLL packets and triggering the in-stream PREROLL behaviour (like SET_NEXT_DISPLAY_TIME). The effect being (here with alsa) to re-enter preroll each time, extending decoder preroll until pts >= preroll_end and flushing decoders.

Stream buffering done (1439 ms in 0 ms) ModuleThread_PlayAudio pts 1 preroll end -9223372036854775808 inserting 3840 zeroes / 80 ms cannot write samples: Relais brisé (pipe) ModuleThread_PlayAudio pts 120001 preroll end 9223372036854775807 (...) ModuleThread_PlayAudio pts 719996 preroll end 719996 end of audio preroll inserting 34804 zeroes / 725 ms 719996 ModuleThread_PlayAudio pts 839996 preroll end 9223372036854775807 (...) ModuleThread_PlayAudio pts 1439992 preroll end 1439992 end of audio preroll inserting 69172 zeroes / 1441 ms 1439992 ModuleThread_PlayAudio pts 1559992 preroll end 9223372036854775807 (...) ModuleThread_PlayAudio pts 2160008 preroll end 2160008 end of audio preroll inserting 103601 zeroes / 2158 ms 2160008 ModuleThread_PlayAudio pts 2280008 preroll end -9223372036854775808 (...)

(manual backport from commit b752ffe1) Signed-off-by: Marvin Scholz epirat07@gmail.com

Edited by Marvin Scholz

Merge request reports