summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2012-11-08 11:40:47 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-11-16 16:49:56 +0100
commit3eeea114b246466f90cf6807269a31a4bd1ec1b2 (patch)
tree258157db074e20a3b11fd9fb3964e477310fe0af /gst-libs/gst/vaapi
parent3da202fa9f6c287775c4b00dbc7a4773d29dd5d2 (diff)
mpeg2: fix PAR calculation from commit 132922d.
Invoke gst_mpeg_video_finalise_mpeg2_sequence_header() to get the correct PAR values. While doing so, require a newer version of the bitstream parser library. Note: it may be necessary to also parse the Sequence_Display_Extension() header. Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com> Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'gst-libs/gst/vaapi')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c
index 7b479057..8bdb13f1 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c
@@ -519,11 +519,9 @@ decode_sequence(GstVaapiDecoderMpeg2 *decoder, guchar *buf, guint buf_size)
pts_set_framerate(&priv->tsg, priv->fps_n, priv->fps_d);
gst_vaapi_decoder_set_framerate(base_decoder, priv->fps_n, priv->fps_d);
- gst_vaapi_decoder_set_pixel_aspect_ratio(
- base_decoder,
- seq_hdr->par_w,
- seq_hdr->par_h
- );
+ if (gst_mpeg_video_finalise_mpeg2_sequence_header(seq_hdr, NULL, NULL))
+ gst_vaapi_decoder_set_pixel_aspect_ratio(base_decoder,
+ seq_hdr->par_w, seq_hdr->par_h);
priv->width = seq_hdr->width;
priv->height = seq_hdr->height;
@@ -539,6 +537,7 @@ decode_sequence_ext(GstVaapiDecoderMpeg2 *decoder, guchar *buf, guint buf_size)
{
GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER(decoder);
GstVaapiDecoderMpeg2Private * const priv = decoder->priv;
+ GstMpegVideoSequenceHdr * const seq_hdr = &priv->seq_hdr;
GstMpegVideoSequenceExt * const seq_ext = &priv->seq_ext;
GstVaapiProfile profile;
guint width, height;
@@ -590,6 +589,11 @@ decode_sequence_ext(GstVaapiDecoderMpeg2 *decoder, guchar *buf, guint buf_size)
priv->profile = profile;
priv->profile_changed = TRUE;
}
+
+ if (gst_mpeg_video_finalise_mpeg2_sequence_header(seq_hdr, seq_ext, NULL))
+ gst_vaapi_decoder_set_pixel_aspect_ratio(base_decoder,
+ seq_hdr->par_w, seq_hdr->par_h);
+
return GST_VAAPI_DECODER_STATUS_SUCCESS;
}