[vlc-devel] [PATCH 10/13] decoder_helpers: ensure we have a non zero SAR output from the decoder

Steve Lhomme robux4 at ycbcr.xyz
Tue Feb 19 10:38:23 CET 2019


---
 src/input/decoder.c         |  9 ---------
 src/input/decoder_helpers.c | 11 +++++++++++
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 54b2877138..9772660097 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -456,15 +456,6 @@ static int vout_update_format( decoder_t *p_dec )
 
         video_format_t fmt = p_dec->fmt_out.video;
 
-        if( !fmt.i_sar_num || !fmt.i_sar_den )
-        {
-            fmt.i_sar_num = 1;
-            fmt.i_sar_den = 1;
-        }
-
-        vlc_ureduce( &fmt.i_sar_num, &fmt.i_sar_den,
-                     fmt.i_sar_num, fmt.i_sar_den, 50000 );
-
         vlc_mutex_lock( &p_owner->lock );
 
         p_vout = p_owner->p_vout;
diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index ee1d4624e6..b210309fd4 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -139,6 +139,17 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
         msg_Warn( dec, "Fixing broken HDTV stream (display_height=1088)");
     }
 
+    if( !fmt_out.i_sar_num || !fmt_out.i_sar_den )
+    {
+        fmt_out.i_sar_num = 1;
+        fmt_out.i_sar_den = 1;
+    }
+    else
+    {
+        vlc_ureduce( &fmt_out.i_sar_num, &fmt_out.i_sar_den,
+                     fmt_out.i_sar_num, fmt_out.i_sar_den, 50000 );
+    }
+
     video_format_t original = dec->fmt_out.video;
     dec->fmt_out.video = fmt_out;
     int err = dec->cbs->video.format_update( dec );
-- 
2.17.1



More information about the vlc-devel mailing list