From fa873969056c534a330bdb7909d6e3c32df769fd Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Thu, 27 Sep 2012 18:05:46 +0100 Subject: [PATCH] h264: use pixel-aspect-ratio from SPS header. Propagate pixel-aspect-ratio determined by the GStreamer codecparser from the sequence headers. Signed-off-by: Simon Farnsworth Signed-off-by: Gwenole Beauchesne --- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index fc6cbf810f..d0ff1ec868 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -689,6 +689,7 @@ end: static GstVaapiDecoderStatus decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu) { + GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER(decoder); GstVaapiDecoderH264Private * const priv = decoder->priv; GstH264SPS * const sps = &priv->last_sps; GstH264ParserResult result; @@ -703,6 +704,11 @@ decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu) if (result != GST_H264_PARSER_OK) return get_status(result); + gst_vaapi_decoder_set_pixel_aspect_ratio( + base_decoder, + sps->vui_parameters.par_n, + sps->vui_parameters.par_d + ); return ensure_context(decoder, sps); }