]> git.sesse.net Git - vlc/commitdiff
* src/video_output/video_output.c: avoid calling config_GetInt in the main loop.
authorGildas Bazin <gbazin@videolan.org>
Mon, 12 Jun 2006 19:51:14 +0000 (19:51 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 12 Jun 2006 19:51:14 +0000 (19:51 +0000)
src/video_output/video_output.c

index bfbc67d00366ab5f52f136fc0d6da385eef118f0..e1a9c4dae4706a570cf104ec99e1b844a4faa62f 100644 (file)
@@ -701,11 +701,18 @@ static void RunThread( vout_thread_t *p_vout)
 
     subpicture_t *  p_subpic = NULL;                   /* subpicture pointer */
 
+    vlc_value_t     val;
+    vlc_bool_t      b_drop_late;
+
     /*
      * Initialize thread
      */
     p_vout->b_error = InitThread( p_vout );
 
+    var_Create( p_vout, "drop-late-frames", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
+    var_Get( p_vout, "drop-late-frames", &val );
+    b_drop_late = val.b_bool;
+
     /* signal the creation of the vout */
     vlc_thread_ready( p_vout );
 
@@ -791,12 +798,10 @@ static void RunThread( vout_thread_t *p_vout)
             p_vout->p_fps_sample[ p_vout->c_fps_samples++ % VOUT_FPS_SAMPLES ]
                 = display_date;
 
-            /* XXX: config_GetInt is slow, but this kind of frame dropping
-             * should not happen that often. */
             if( !p_picture->b_force &&
                 p_picture != p_last_picture &&
                 display_date < current_date + p_vout->render_time &&
-                config_GetInt( p_vout, "drop-late-frames" ) )
+                b_drop_late )
             {
                 /* Picture is late: it will be destroyed and the thread
                  * will directly choose the next picture */