]> git.sesse.net Git - vlc/commitdiff
mmal/vout: Use current pictures format for rate matching
authorJulian Scheel <julian@jusst.de>
Thu, 9 Oct 2014 12:49:40 +0000 (14:49 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 9 Oct 2014 12:53:12 +0000 (14:53 +0200)
Instead of using the video_format which was set on output creation, always
check the refreshrate against the current pictures frame duration.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/hw/mmal/vout.c

index c23f4632eb76f6d5bd0ecc2197a291dc40434829..a79ba33e9e998672c89cb2d21d2a142860388d2e 100644 (file)
@@ -144,7 +144,7 @@ static void input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer);
 static int query_resolution(vout_display_t *vd, unsigned *width, unsigned *height);
 static void tvservice_cb(void *callback_data, uint32_t reason, uint32_t param1,
                 uint32_t param2);
-static void adjust_refresh_rate(vout_display_t *vd);
+static void adjust_refresh_rate(vout_display_t *vd, const video_format_t *fmt);
 static int set_latency_target(vout_display_t *vd, bool enable);
 
 /* DispManX */
@@ -412,7 +412,7 @@ static int configure_display(vout_display_t *vd, const vout_display_cfg_t *cfg,
     show_background(vd, cfg->is_fullscreen);
     sys->adjust_refresh_rate = var_InheritBool(vd, MMAL_ADJUST_REFRESHRATE_NAME);
     if (sys->adjust_refresh_rate) {
-        adjust_refresh_rate(vd);
+        adjust_refresh_rate(vd, fmt);
         set_latency_target(vd, true);
     }
 
@@ -754,12 +754,12 @@ static int set_latency_target(vout_display_t *vd, bool enable)
     return VLC_SUCCESS;
 }
 
-static void adjust_refresh_rate(vout_display_t *vd)
+static void adjust_refresh_rate(vout_display_t *vd, const video_format_t *fmt)
 {
     TV_DISPLAY_STATE_T display_state;
     TV_SUPPORTED_MODE_NEW_T supported_modes[VC_TV_MAX_MODE_IDS];
     int num_modes;
-    double frame_rate = (double)vd->fmt.i_frame_rate / vd->fmt.i_frame_rate_base;
+    double frame_rate = (double)fmt->i_frame_rate / fmt->i_frame_rate_base;
     int best_id = -1;
     double best_score, score;
     int i;