[vlc-devel] [PATCH 13/17] bluray: handle matching time

Thomas Guillem thomas at gllm.fr
Tue Mar 9 15:15:42 UTC 2021


---
 modules/access/bluray.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index d6278d13319..4401f8220f3 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1562,6 +1562,32 @@ static int bluray_esOutControl(es_out_t *p_out, input_source_t *in, int i_query,
             i_ret = VLC_SUCCESS;
             break;
 
+        case ES_OUT_SET_GROUP_PCR:
+        case ES_OUT_SET_PCR:
+        {
+            demux_t *p_demux = esout_priv->priv;
+            demux_sys_t *p_sys = p_demux->p_sys;
+
+            /* Match the subdemux PCR with the bluray time */
+            int i_group = 0;
+            if (i_query == ES_OUT_SET_GROUP_PCR)
+                i_group = va_arg( args, int );
+
+            vlc_tick_t i_pcr = va_arg( args, vlc_tick_t );
+            vlc_tick_t i_matching_time = va_arg( args, vlc_tick_t );
+            if (p_sys->cur_title < p_sys->i_title &&
+                !(CURRENT_TITLE->i_flags & INPUT_TITLE_INTERACTIVE))
+                i_matching_time = FROM_SCALE_NZ(bd_tell_time(p_sys->bluray));
+
+            if (i_query == ES_OUT_SET_GROUP_PCR)
+                i_ret = es_out_Control(esout_priv->p_dst_out, i_query, i_group,
+                                       i_pcr, i_matching_time);
+            else
+                i_ret = es_out_Control(esout_priv->p_dst_out, i_query,
+                                       i_pcr, i_matching_time);
+            break;
+        }
+
         default:
             i_ret = es_out_vaControl(esout_priv->p_dst_out, i_query, args);
             break;
-- 
2.30.0



More information about the vlc-devel mailing list