vpx: default fmt_out aspect ratio to 1:1 if unset
authorTristan Matthews <tmatth@videolan.org>
Sun, 5 Jun 2016 08:49:26 +0000 (10:49 +0200)
committerTristan Matthews <tmatth@videolan.org>
Sun, 5 Jun 2016 09:06:17 +0000 (11:06 +0200)
Fixes transcoding issues

modules/codec/vpx.c

index 4d5cb14..d31428e 100644 (file)
@@ -163,6 +163,15 @@ static picture_t *Decode(decoder_t *dec, block_t **pp_block)
         v->i_visible_height = img->d_h;
     }
 
+    if( !dec->fmt_in.video.i_sar_num || !dec->fmt_in.video.i_sar_den )
+    {
+        if( !dec->fmt_out.video.i_sar_num || !dec->fmt_out.video.i_sar_den )
+        {
+            dec->fmt_out.video.i_sar_num = 1;
+            dec->fmt_out.video.i_sar_den = 1;
+        }
+    }
+
     picture_t *pic = decoder_NewPicture(dec);
     if (!pic)
         return NULL;