]> git.sesse.net Git - vlc/commitdiff
* src/video_output/vout_synchro.c: Added a --no-skip-frames option (for
authorChristophe Massiot <massiot@videolan.org>
Wed, 8 Dec 2004 00:15:30 +0000 (00:15 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 8 Dec 2004 00:15:30 +0000 (00:15 +0000)
  compatibility with MPEG-2 HD, the current frame skipping algorithm seems
  to be too aggressive).

include/vout_synchro.h
src/libvlc.h
src/video_output/vout_synchro.c

index 8445a6004c793977f1d9700c2509316e2bf24966..0ffae074391cf41fe99fd717dc71e6d9f9b8f3e1 100644 (file)
@@ -2,7 +2,7 @@
  * vout_synchro.h: frame-dropping structures
  *****************************************************************************
  * Copyright (C) 1999-2003 VideoLAN
- * $Id: vout_synchro.h,v 1.4 2004/01/25 18:17:08 zorglub Exp $
+ * $Id$
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
@@ -36,6 +36,7 @@ struct vout_synchro_t
     vout_thread_t * p_vout;
     int             i_frame_rate;
     int             i_current_rate;
+    vlc_bool_t      b_no_skip;
 
     /* date of the beginning of the decoding of the current picture */
     mtime_t         decoding_start;
index 6e9c1a99356936ddc2bfc7a581a33f16199ff0aa..8d00c5b1ba7c8bca1a6353d5f12b760c013b2d34 100644 (file)
@@ -252,6 +252,10 @@ static char *ppsz_align_descriptions[] =
     "aspect, or a float value (1.25, 1.3333, etc.) expressing pixel " \
     "squareness.")
 
+#define SKIP_FRAMES_TEXT N_("Skip frames")
+#define SKIP_FRAMES_LONGTEXT N_( \
+    "Disable this option to disable frame drops on MPEG-2 streams.")
+
 #define INPUT_CAT_LONGTEXT N_( \
     "These options allow you to modify the behavior of the input " \
     "subsystem, such as the DVD or VCD device, the network interface " \
@@ -879,6 +883,8 @@ vlc_module_begin();
     add_bool( "fullscreen", 0, NULL, FULLSCREEN_TEXT,
               FULLSCREEN_LONGTEXT, VLC_FALSE );
         change_short('f');
+    add_bool( "skip-frames", 1, NULL, SKIP_FRAMES_TEXT,
+              SKIP_FRAMES_LONGTEXT, VLC_FALSE );
 #ifndef SYS_DARWIN
     add_bool( "overlay", 1, NULL, OVERLAY_TEXT, OVERLAY_LONGTEXT, VLC_TRUE );
 #endif
index 94d396b6fdfb6a8d42d3855e8584e7edde1087aa..058f43fcbb424af38cad65cd1adb665e8e1a3309 100644 (file)
@@ -129,6 +129,8 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object,
     }
     vlc_object_attach( p_synchro, p_object );
 
+    p_synchro->b_no_skip = !config_GetInt( p_object, "skip-frames" );
+
     /* We use a fake stream pattern, which is often right. */
     p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;
     p_synchro->i_n_b = p_synchro->i_eta_b = DEFAULT_NB_B;
@@ -175,11 +177,13 @@ vlc_bool_t vout_SynchroChoose( vout_synchro_t * p_synchro, int i_coding_type,
                                     + (p_synchro->p_tau[(coding_type)] >> 1) \
                                     + p_synchro->i_render_time)
 #define S (*p_synchro)
-    /* VPAR_SYNCHRO_DEFAULT */
     mtime_t         now, period;
     mtime_t         pts = 0;
     vlc_bool_t      b_decode = 0;
 
+    if ( p_synchro->b_no_skip )
+        return 1;
+
     now = mdate();
     period = 1000000 * 1001 / p_synchro->i_frame_rate
                      * p_synchro->i_current_rate / INPUT_RATE_DEFAULT;