[vlc-commits] access: bluray: do not report time/position for interactive menus
Francois Cartegnie
git at videolan.org
Tue Oct 30 18:12:20 CET 2018
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Apr 13 07:31:39 2018 +0200| [9d735f6bb21cab00b48eb67fd14e6a34843346c9] | committer: Francois Cartegnie
access: bluray: do not report time/position for interactive menus
(cherry picked from commit 0dea268d73df247951072f678aeba6d14b1dda68)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9d735f6bb21cab00b48eb67fd14e6a34843346c9
---
modules/access/bluray.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index c2d482105d..8b6ecbd140 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -285,7 +285,8 @@ static void notifyDiscontinuity( 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)
-#define CUR_LENGTH p_sys->pp_title[p_demux->info.i_title]->i_length
+#define CURRENT_TITLE p_sys->pp_title[p_demux->info.i_title]
+#define CUR_LENGTH CURRENT_TITLE->i_length
/* */
static void FindMountPoint(char **file)
@@ -1880,7 +1881,10 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
case DEMUX_GET_LENGTH:
{
int64_t *pi_length = va_arg(args, int64_t *);
- *pi_length = p_demux->info.i_title < (int)p_sys->i_title ? CUR_LENGTH : 0;
+ if(p_demux->info.i_title < (int) p_sys->i_title &&
+ (CURRENT_TITLE->i_flags & INPUT_TITLE_INTERACTIVE))
+ return VLC_EGENERIC;
+ *pi_length = p_demux->info.i_title < (int) p_sys->i_title ? CUR_LENGTH : 0;
return VLC_SUCCESS;
}
case DEMUX_SET_TIME:
@@ -1893,6 +1897,9 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
case DEMUX_GET_TIME:
{
int64_t *pi_time = va_arg(args, int64_t *);
+ if( p_demux->info.i_title < (int) p_sys->i_title &&
+ (CURRENT_TITLE->i_flags & INPUT_TITLE_INTERACTIVE))
+ return VLC_EGENERIC;
*pi_time = (int64_t)FROM_TICKS(bd_tell_time(p_sys->bluray));
return VLC_SUCCESS;
}
@@ -1900,7 +1907,10 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
case DEMUX_GET_POSITION:
{
double *pf_position = va_arg(args, double *);
- *pf_position = p_demux->info.i_title < (int)p_sys->i_title && CUR_LENGTH > 0 ?
+ if(p_demux->info.i_title < (int) p_sys->i_title &&
+ (CURRENT_TITLE->i_flags & INPUT_TITLE_INTERACTIVE))
+ return VLC_EGENERIC;
+ *pf_position = p_demux->info.i_title < (int) p_sys->i_title && CUR_LENGTH > 0 ?
(double)FROM_TICKS(bd_tell_time(p_sys->bluray))/CUR_LENGTH : 0.0;
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list