From efc0d82b7be3aa1894c8ab3267ca673ab035a9a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= <fcvlcdev@free.fr>
Date: Thu, 14 Nov 2024 21:31:10 +0700
Subject: [PATCH] demux: h26x: restore missing PCR

regression by 4d691734b189ccae3300c8d0d40eb6428fadd486

refs #28871

for some reason SetPCR was removed
---
 modules/demux/mpeg/h26x.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/demux/mpeg/h26x.c b/modules/demux/mpeg/h26x.c
index f3ffbae12681..23239074ee7c 100644
--- a/modules/demux/mpeg/h26x.c
+++ b/modules/demux/mpeg/h26x.c
@@ -480,6 +480,10 @@ static int Demux( demux_t *p_demux)
             bool frame = p_block_out->i_flags & BLOCK_FLAG_TYPE_MASK;
             const vlc_tick_t i_frame_length = p_block_out->i_length;
 
+            /* first output */
+            if( date_Get( &p_sys->output_dts ) == VLC_TICK_0 )
+                es_out_SetPCR( p_demux->out, date_Get( &p_sys->output_dts ) );
+
             es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
 
             vlc_tick_t pcr = b_eof ? dts : date_Get( &p_sys->output_dts );
@@ -499,6 +503,8 @@ static int Demux( demux_t *p_demux)
                 }
             }
 
+            es_out_SetPCR( p_demux->out, pcr );
+
             p_block_out = p_next;
         }
     }
-- 
GitLab