[vlc-commits] input: do not clobber master frame rate

Rémi Denis-Courmont git at videolan.org
Sat Oct 24 20:33:38 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 24 21:32:29 2015 +0300| [cf5951e9762f7ce1f288866ffde808fc4f16e3ca] | committer: Rémi Denis-Courmont

input: do not clobber master frame rate

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

 src/input/input.c          |    7 +++----
 src/input/input_internal.h |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 16d9aac..f03d92b 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -912,7 +912,7 @@ static void LoadSubtitles( input_thread_t *p_input )
 {
     /* Load subtitles */
     /* Get fps and set it if not already set */
-    const float f_fps = p_input->p->f_fps;
+    const float f_fps = p_input->p->master->f_fps;
     if( f_fps > 1.f )
     {
         var_Create( p_input, "sub-original-fps", VLC_VAR_FLOAT );
@@ -2095,7 +2095,6 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,
         return NULL;
 
     const char *psz_access, *psz_demux, *psz_path, *psz_anchor = NULL;
-    double f_fps;
 
     assert( psz_mrl );
     char *psz_dup = strdup( psz_mrl );
@@ -2272,8 +2271,8 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,
             in->i_pts_delay = 0;
     }
 
-    if( !demux_Control( in->p_demux, DEMUX_GET_FPS, &f_fps ) && f_fps > 0.0 )
-        p_input->p->f_fps = f_fps;
+    if( demux_Control( in->p_demux, DEMUX_GET_FPS, &in->f_fps ) )
+        in->f_fps = 0.f;
 
     if( var_GetInteger( p_input, "clock-synchro" ) != -1 )
         in->b_can_pace_control = !var_GetInteger( p_input, "clock-synchro" );
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index f7aa714..0020144 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -63,6 +63,7 @@ typedef struct
     bool b_can_rate_control;
     bool b_can_stream_record;
     bool b_rescale_ts;
+    double f_fps;
 
     /* */
     int64_t i_pts_delay;
@@ -81,7 +82,6 @@ typedef struct
 struct input_thread_private_t
 {
     /* Global properties */
-    double      f_fps;
     bool        b_can_pause;
     bool        b_can_rate_control;
     bool        b_can_pace_control;



More information about the vlc-commits mailing list