vc1: use pixel-aspect-ratio from bitstream parser.
authorSimon Farnsworth <simon.farnsworth@onelan.co.uk>
Thu, 27 Sep 2012 17:05:46 +0000 (18:05 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 11 Oct 2012 13:00:44 +0000 (15:00 +0200)
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
gst-libs/gst/vaapi/gstvaapidecoder_vc1.c

index d54a18a..96a58de 100644 (file)
@@ -248,7 +248,7 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
     GstVC1SeqStructC * const structc = &seq_hdr->struct_c;
     GstVC1ParserResult result;
     GstVaapiProfile profile;
-    guint width, height, fps_n, fps_d;
+    guint width, height, fps_n, fps_d, par_n, par_d;
 
     result = gst_vc1_parse_sequence_header(
         rbdu->data + rbdu->offset,
@@ -275,6 +275,8 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
 
     fps_n = 0;
     fps_d = 0;
+    par_n = 0;
+    par_d = 0;
     switch (seq_hdr->profile) {
     case GST_VC1_PROFILE_SIMPLE:
     case GST_VC1_PROFILE_MAIN:
@@ -321,6 +323,8 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
                 fps_d = frameratedr_table[adv_hdr->frameratedr];
             }
         }
+        par_n = adv_hdr->par_n;
+        par_d = adv_hdr->par_d;
         break;
     default:
         g_assert(0 && "XXX: we already validated the profile above");
@@ -332,6 +336,9 @@ decode_sequence(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
         gst_vaapi_decoder_set_framerate(base_decoder, priv->fps_n, priv->fps_d);
     }
 
+    if (par_n > 0 && par_d > 0)
+        gst_vaapi_decoder_set_pixel_aspect_ratio(base_decoder, par_n, par_d);
+
     switch (seq_hdr->profile) {
     case GST_VC1_PROFILE_SIMPLE:
     case GST_VC1_PROFILE_MAIN: