[vlc-commits] access: bluray: enforce seamless timestamps between clips

Francois Cartegnie git at videolan.org
Mon Oct 22 20:27:30 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue May  8 15:24:46 2018 +0200| [61a6647c1155a5ca2d1f4f47dddb1c32a693655e] | committer: Francois Cartegnie

access: bluray: enforce seamless timestamps between clips

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=61a6647c1155a5ca2d1f4f47dddb1c32a693655e
---

 modules/access/Makefile.am |  3 ++-
 modules/access/bluray.c    | 18 ++++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/modules/access/Makefile.am b/modules/access/Makefile.am
index 222aa16c6b..5abe3a1a5f 100644
--- a/modules/access/Makefile.am
+++ b/modules/access/Makefile.am
@@ -244,7 +244,8 @@ endif
 access_LTLIBRARIES += $(LTLIBdvdnav)
 EXTRA_LTLIBRARIES += libdvdnav_plugin.la
 
-libdvdread_plugin_la_SOURCES = access/dvdread.c demux/mpeg/ps.h demux/mpeg/pes.h
+libdvdread_plugin_la_SOURCES = access/dvdread.c demux/mpeg/ps.h demux/mpeg/pes.h \
+                               demux/moving_avg.h demux/timestamps_filter.h
 libdvdread_plugin_la_CFLAGS = $(AM_CFLAGS) $(DVDREAD_CFLAGS)
 libdvdread_plugin_la_LIBADD = $(DVDREAD_LIBS)
 libdvdread_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(accessdir)'
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 9163bfd801..49833890d2 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -52,6 +52,7 @@
 #include <vlc_fs.h>
 
 #include "../demux/mpeg/timestamps.h"
+#include "../demux/timestamps_filter.h"
 
 /* FIXME we should find a better way than including that */
 #include "../../src/text/iso-639_def.h"
@@ -207,6 +208,7 @@ typedef struct
     es_out_id_t         *p_video_es;
 
     /* TS stream */
+    es_out_t            *p_tf_out;
     es_out_t            *p_out;
     bool                b_spu_enable;       /* enabled / disabled */
     vlc_demux_chained_t *p_parser;
@@ -936,7 +938,11 @@ static int blurayOpen(vlc_object_t *object)
         }
     }
 
-    p_sys->p_out = esOutNew(VLC_OBJECT(p_demux), p_demux->out, p_demux);
+    p_sys->p_tf_out = timestamps_filter_es_out_New(p_demux->out);
+    if(unlikely(!p_sys->p_tf_out))
+        goto error;
+
+    p_sys->p_out = esOutNew(VLC_OBJECT(p_demux), p_sys->p_tf_out, p_demux);
     if (unlikely(p_sys->p_out == NULL))
         goto error;
 
@@ -994,7 +1000,11 @@ static void blurayClose(vlc_object_t *object)
 
     if (p_sys->p_parser)
         vlc_demux_chained_Delete(p_sys->p_parser);
-    es_out_Delete(p_sys->p_out);
+
+    if (p_sys->p_out != NULL)
+        es_out_Delete(p_sys->p_out);
+    if(p_sys->p_tf_out)
+        timestamps_filter_es_out_Delete(p_sys->p_tf_out);
 
     /* Titles */
     for (unsigned int i = 0; i < p_sys->i_title; i++)
@@ -1968,6 +1978,9 @@ static void blurayRestartParser(demux_t *p_demux, bool b_flush)
     if (p_sys->p_parser)
         vlc_demux_chained_Delete(p_sys->p_parser);
 
+    if(b_flush)
+        es_out_Control(p_sys->p_tf_out, ES_OUT_TF_FILTER_RESET);
+
     p_sys->p_parser = vlc_demux_chained_New(VLC_OBJECT(p_demux), "ts", p_sys->p_out);
     if (!p_sys->p_parser)
         msg_Err(p_demux, "Failed to create TS demuxer");
@@ -2565,6 +2578,7 @@ static void blurayHandleEvent(demux_t *p_demux, const BD_EVENT *e)
         p_sys->b_pl_playing = true;
         break;
     case BD_EVENT_PLAYITEM:
+        notifyDiscontinuityToParser(p_sys);
         blurayUpdateCurrentClip(p_demux, e->param);
         break;
     case BD_EVENT_CHAPTER:



More information about the vlc-commits mailing list