[vlc-commits] demux: asf: only apply valid A/R

Francois Cartegnie git at videolan.org
Tue Mar 25 17:40:20 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar 25 16:37:36 2014 +0100| [11662eb81928c230871746131ef4dd04315514ad] | committer: Francois Cartegnie

demux: asf: only apply valid A/R

refs #11063

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

 modules/demux/asf/asf.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 62795f6..6b339f0 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -658,15 +658,19 @@ static void ParsePayloadExtensions(demux_t *p_demux, asf_track_t *tk,
             uint8_t i_ratio_y = *(p_data + 1);
             if ( tk->p_fmt->video.i_sar_num != i_ratio_x || tk->p_fmt->video.i_sar_den != i_ratio_y )
             {
-                vout_thread_t *p_vout = input_GetVout( p_demux->p_input );
-                if ( p_vout )
+                /* Only apply if origin pixel size >= 1x1, due to broken yacast */
+                if ( tk->p_fmt->video.i_height * i_ratio_x > tk->p_fmt->video.i_width * i_ratio_y )
                 {
-                    msg_Info( p_demux, "Changing aspect ratio to %i/%i", i_ratio_x, i_ratio_y );
-                    tk->p_fmt->video.i_sar_num = i_ratio_x;
-                    tk->p_fmt->video.i_sar_den = i_ratio_y;
-                    vout_ChangeAspectRatio( p_vout, i_ratio_x, i_ratio_y );
-                    vlc_object_release( p_vout );
+                    vout_thread_t *p_vout = input_GetVout( p_demux->p_input );
+                    if ( p_vout )
+                    {
+                        msg_Info( p_demux, "Changing aspect ratio to %i/%i", i_ratio_x, i_ratio_y );
+                        vout_ChangeAspectRatio( p_vout, i_ratio_x, i_ratio_y );
+                        vlc_object_release( p_vout );
+                    }
                 }
+                tk->p_fmt->video.i_sar_num = i_ratio_x;
+                tk->p_fmt->video.i_sar_den = i_ratio_y;
             }
         }
         i_length -= i_payload_extensions_size;



More information about the vlc-commits mailing list