[vlc-commits] access: bluray: unify behaviour of all random access

Francois Cartegnie git at videolan.org
Tue Oct 30 18:12:36 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Oct 21 12:37:11 2018 +0200| [b05693e03c65733af9a4c9d08b3fbe6cf5b008ad] | committer: Francois Cartegnie

access: bluray: unify behaviour of all random access

(cherry picked from commit 4cf129654a404239e52b9a1ad913c5a1493a8b90)

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

 modules/access/bluray.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 2003b4dce0..ebd4cb4b54 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -349,8 +349,8 @@ static int   onMouseEvent(vlc_object_t *p_vout, const char *psz_var,
 static int   onIntfEvent(vlc_object_t *, char const *,
                          vlc_value_t, vlc_value_t, void *);
 
-static void  blurayResetParser(demux_t *p_demux);
-static void  notifyDiscontinuity( demux_sys_t *p_sys );
+static void  blurayRestartParser(demux_t *p_demux);
+static void  notifyDiscontinuityToParser( demux_sys_t *p_sys );
 
 #define FROM_TICKS(a) ((a)*CLOCK_FREQ / INT64_C(90000))
 #define TO_TICKS(a)   ((a)*INT64_C(90000)/CLOCK_FREQ)
@@ -910,7 +910,7 @@ static int blurayOpen(vlc_object_t *object)
     if (unlikely(p_sys->p_out == NULL))
         goto error;
 
-    blurayResetParser(p_demux);
+    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");
         goto error;
@@ -1862,7 +1862,7 @@ static void blurayInitTitles(demux_t *p_demux, uint32_t menu_titles)
     }
 }
 
-static void blurayResetParser(demux_t *p_demux)
+static void blurayRestartParser(demux_t *p_demux)
 {
     /*
      * This is a hack and will have to be removed.
@@ -2007,15 +2007,16 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
             p_demux->info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_SEEKPOINT;
             return VLC_EGENERIC;
         }
-        blurayResetParser( p_demux );
-        notifyDiscontinuity( p_sys );
+        blurayRestartParser(p_demux);
+        notifyDiscontinuityToParser(p_sys);
         break;
     }
     case DEMUX_SET_SEEKPOINT:
     {
         int i_chapter = va_arg(args, int);
         bd_seek_chapter(p_sys->bluray, i_chapter);
-        notifyDiscontinuity( p_sys );
+        blurayRestartParser(p_demux);
+        notifyDiscontinuityToParser(p_sys);
         p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
         break;
     }
@@ -2059,7 +2060,8 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
     {
         int64_t i_time = va_arg(args, int64_t);
         bd_seek_time(p_sys->bluray, TO_TICKS(i_time));
-        notifyDiscontinuity( p_sys );
+        blurayRestartParser(p_demux);
+        notifyDiscontinuityToParser(p_sys);
         return VLC_SUCCESS;
     }
     case DEMUX_GET_TIME:
@@ -2086,7 +2088,8 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
     {
         double f_position = va_arg(args, double);
         bd_seek_time(p_sys->bluray, TO_TICKS(f_position*CUR_LENGTH));
-        notifyDiscontinuity( p_sys );
+        blurayRestartParser(p_demux);
+        notifyDiscontinuityToParser(p_sys);
         return VLC_SUCCESS;
     }
 
@@ -2231,7 +2234,7 @@ static void notifyStreamsDiscontinuity( vlc_demux_chained_t *p_parser,
 #define DONOTIFY(memb) notifyStreamsDiscontinuity( p_sys->p_parser, p_clip->memb##_streams, \
                                                    p_clip->memb##_stream_count )
 
-static void notifyDiscontinuity( demux_sys_t *p_sys )
+static void notifyDiscontinuityToParser( demux_sys_t *p_sys )
 {
     const BLURAY_CLIP_INFO *p_clip = p_sys->p_clip_info;
     if( p_clip )
@@ -2311,7 +2314,7 @@ static void blurayResetStillImage( demux_t *p_demux )
     if (p_sys->i_still_end_time != STILL_IMAGE_NOT_SET) {
         p_sys->i_still_end_time = STILL_IMAGE_NOT_SET;
 
-        blurayResetParser(p_demux);
+        blurayRestartParser(p_demux);
         es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
     }
 }
@@ -2380,7 +2383,7 @@ static void blurayUpdatePlaylist(demux_t *p_demux, unsigned i_playlist)
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    blurayResetParser(p_demux);
+    blurayRestartParser(p_demux);
 
     /* read title info and init some values */
     if (!p_sys->b_menu)
@@ -2443,7 +2446,7 @@ static void blurayHandleEvent(demux_t *p_demux, const BD_EVENT *e)
         if (p_sys->b_pl_playing) {
             /* previous playlist was stopped in middle. flush to avoid delay */
             msg_Info(p_demux, "Stopping playlist playback");
-            blurayResetParser(p_demux);
+            blurayRestartParser(p_demux);
             es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
         }
         p_sys->b_pl_playing = true;
@@ -2518,7 +2521,7 @@ static void blurayHandleEvent(demux_t *p_demux, const BD_EVENT *e)
         break;
     case BD_EVENT_DISCONTINUITY:
         /* reset demuxer (partially decoded PES packets must be dropped) */
-        blurayResetParser(p_demux);
+        blurayRestartParser(p_demux);
         break;
     case BD_EVENT_END_OF_TITLE:
         p_sys->b_pl_playing = false;



More information about the vlc-commits mailing list