committed by
Nicolas Pomepuy
16 changed files with 272 additions and 80 deletions
@ -0,0 +1,47 @@ |
|||
From 3e02d1956f4859ed915e6b25be70227bbd6f3492 Mon Sep 17 00:00:00 2001 |
|||
From: Thomas Guillem <thomas@gllm.fr> |
|||
Date: Mon, 9 Aug 2021 13:29:56 +0200 |
|||
Subject: [PATCH] MediaPlayer: always use set_time/set_position fast argument |
|||
|
|||
---
|
|||
vlcpp/MediaPlayer.hpp | 10 ++++++---- |
|||
1 file changed, 6 insertions(+), 4 deletions(-) |
|||
|
|||
diff --git a/vlcpp/MediaPlayer.hpp b/vlcpp/MediaPlayer.hpp
|
|||
index 24aeb24..9d8eecd 100644
|
|||
--- a/vlcpp/MediaPlayer.hpp
|
|||
+++ b/vlcpp/MediaPlayer.hpp
|
|||
@@ -31,6 +31,8 @@
|
|||
|
|||
#include "common.hpp" |
|||
|
|||
+#define FORCE_FASTSEEK_API
|
|||
+
|
|||
namespace VLC |
|||
{ |
|||
|
|||
@@ -339,8 +341,8 @@ public:
|
|||
* \version{4.x} |
|||
* \param b_fast prefer fast seeking or precise seeking |
|||
*/ |
|||
-#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
|
|||
- void setTime(libvlc_time_t i_time, bool b_fast)
|
|||
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0) || defined(FORCE_FASTSEEK_API)
|
|||
+ void setTime(libvlc_time_t i_time, bool b_fast = false)
|
|||
{ |
|||
libvlc_media_player_set_time(*this, i_time, b_fast); |
|||
} |
|||
@@ -372,8 +374,8 @@ public:
|
|||
* \version{4.x} |
|||
* \param b_fast prefer fast seeking or precise seeking |
|||
*/ |
|||
-#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
|
|||
- void setPosition(float f_pos, bool b_fast)
|
|||
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0) || defined(FORCE_FASTSEEK_API)
|
|||
+ void setPosition(float f_pos, bool b_fast = false)
|
|||
{ |
|||
libvlc_media_player_set_position(*this, f_pos, b_fast); |
|||
} |
|||
--
|
|||
2.30.2 |
|||
|
|||
@ -0,0 +1,135 @@ |
|||
From be372d1971f389a25b75995b631d61b82f5d7b4d Mon Sep 17 00:00:00 2001 |
|||
Message-Id: <be372d1971f389a25b75995b631d61b82f5d7b4d.1628587500.git.thomas@gllm.fr> |
|||
In-Reply-To: <725e37106e83190ea20042aa9dc01c1c7646b37d.1628587500.git.thomas@gllm.fr> |
|||
References: <725e37106e83190ea20042aa9dc01c1c7646b37d.1628587500.git.thomas@gllm.fr> |
|||
From: Thomas Guillem <thomas@gllm.fr> |
|||
Date: Wed, 4 Aug 2021 13:33:50 +0200 |
|||
Subject: [PATCH 12/13] media_player: backport fast seek argument |
|||
|
|||
The fast-seek option is not global anymore but related to each seek |
|||
requests. |
|||
---
|
|||
include/vlc/libvlc_media_player.h | 8 ++++++-- |
|||
lib/media_player.c | 6 ++++-- |
|||
src/input/input.c | 7 +++---- |
|||
src/input/input_internal.h | 1 - |
|||
4 files changed, 13 insertions(+), 9 deletions(-) |
|||
|
|||
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
|
|||
index bc0d1f774c..007a5eb419 100644
|
|||
--- a/include/vlc/libvlc_media_player.h
|
|||
+++ b/include/vlc/libvlc_media_player.h
|
|||
@@ -801,8 +801,10 @@ LIBVLC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_
|
|||
* |
|||
* \param p_mi the Media Player |
|||
* \param i_time the movie time (in ms). |
|||
+ * \param b_fast prefer fast seeking or precise seeking
|
|||
*/ |
|||
-LIBVLC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
|
|||
+LIBVLC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi,
|
|||
+ libvlc_time_t i_time, bool b_fast );
|
|||
|
|||
/** |
|||
* Get movie position as percentage between 0.0 and 1.0. |
|||
@@ -819,8 +821,10 @@ LIBVLC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi )
|
|||
* |
|||
* \param p_mi the Media Player |
|||
* \param f_pos the position |
|||
+ * \param b_fast prefer fast seeking or precise seeking
|
|||
*/ |
|||
-LIBVLC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
|
|||
+LIBVLC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi,
|
|||
+ float f_pos, bool b_fast );
|
|||
|
|||
/** |
|||
* Set movie chapter (if applicable). |
|||
diff --git a/lib/media_player.c b/lib/media_player.c
|
|||
index 15686ba864..0fd04c5c24 100644
|
|||
--- a/lib/media_player.c
|
|||
+++ b/lib/media_player.c
|
|||
@@ -1383,7 +1383,7 @@ libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi )
|
|||
} |
|||
|
|||
void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, |
|||
- libvlc_time_t i_time )
|
|||
+ libvlc_time_t i_time, bool b_fast )
|
|||
{ |
|||
input_thread_t *p_input_thread; |
|||
|
|||
@@ -1391,12 +1391,13 @@ void libvlc_media_player_set_time( libvlc_media_player_t *p_mi,
|
|||
if( !p_input_thread ) |
|||
return; |
|||
|
|||
+ var_SetBool( p_input_thread, "input-fast-seek", b_fast );
|
|||
var_SetInteger( p_input_thread, "time", to_mtime(i_time) ); |
|||
vlc_object_release( p_input_thread ); |
|||
} |
|||
|
|||
void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, |
|||
- float position )
|
|||
+ float position, bool b_fast )
|
|||
{ |
|||
input_thread_t *p_input_thread; |
|||
|
|||
@@ -1404,6 +1405,7 @@ void libvlc_media_player_set_position( libvlc_media_player_t *p_mi,
|
|||
if( !p_input_thread ) |
|||
return; |
|||
|
|||
+ var_SetBool( p_input_thread, "input-fast-seek", b_fast );
|
|||
var_SetFloat( p_input_thread, "position", position ); |
|||
vlc_object_release( p_input_thread ); |
|||
} |
|||
diff --git a/src/input/input.c b/src/input/input.c
|
|||
index fb4020594e..0497f06673 100644
|
|||
--- a/src/input/input.c
|
|||
+++ b/src/input/input.c
|
|||
@@ -969,7 +969,6 @@ static void StartTitle( input_thread_t * p_input )
|
|||
msg_Warn( p_input, "invalid stop-time ignored" ); |
|||
priv->i_stop = 0; |
|||
} |
|||
- priv->b_fast_seek = var_GetBool( p_input, "input-fast-seek" );
|
|||
} |
|||
|
|||
static int SlaveCompare(const void *a, const void *b) |
|||
@@ -2010,7 +2009,7 @@ static bool Control( input_thread_t *p_input,
|
|||
/* Reset the decoders states and clock sync (before calling the demuxer */ |
|||
es_out_SetTime( input_priv(p_input)->p_es_out, -1 ); |
|||
if( demux_Control( input_priv(p_input)->master->p_demux, DEMUX_SET_POSITION, |
|||
- (double) f_pos, !input_priv(p_input)->b_fast_seek ) )
|
|||
+ (double) f_pos, !var_GetBool( p_input, "input-fast-seek" ) ) )
|
|||
{ |
|||
msg_Err( p_input, "INPUT_CONTROL_SET_POSITION " |
|||
"%2.1f%% failed", (double)(f_pos * 100.f) ); |
|||
@@ -2046,7 +2045,7 @@ static bool Control( input_thread_t *p_input,
|
|||
|
|||
i_ret = demux_Control( input_priv(p_input)->master->p_demux, |
|||
DEMUX_SET_TIME, i_time, |
|||
- !input_priv(p_input)->b_fast_seek );
|
|||
+ !var_GetBool( p_input, "input-fast-seek" ) );
|
|||
if( i_ret ) |
|||
{ |
|||
int64_t i_length; |
|||
@@ -2059,7 +2058,7 @@ static bool Control( input_thread_t *p_input,
|
|||
f_pos = VLC_CLIP(f_pos, 0.0, 1.0); |
|||
i_ret = demux_Control( input_priv(p_input)->master->p_demux, |
|||
DEMUX_SET_POSITION, f_pos, |
|||
- !input_priv(p_input)->b_fast_seek );
|
|||
+ !var_GetBool( p_input, "input-fast-seek" ) );
|
|||
} |
|||
} |
|||
if( i_ret ) |
|||
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
|
|||
index b79df99cac..a43864ef36 100644
|
|||
--- a/src/input/input_internal.h
|
|||
+++ b/src/input/input_internal.h
|
|||
@@ -103,7 +103,6 @@ typedef struct input_thread_private_t
|
|||
int64_t i_start; /* :start-time,0 by default */ |
|||
int64_t i_stop; /* :stop-time, 0 if none */ |
|||
int64_t i_time; /* Current time */ |
|||
- bool b_fast_seek;/* :input-fast-seek */
|
|||
|
|||
/* Output */ |
|||
bool b_out_pace_control; /* XXX Move it ot es_sout ? */ |
|||
--
|
|||
2.30.2 |
|||
|
|||
Loading…
Reference in new issue