diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2013-06-05 16:16:36 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-07-06 00:40:54 +0100 |
commit | 27ed14c3faf0c247b90f5e2f7b629fce8273a416 (patch) | |
tree | e1a402500fd580226d8d00f343da1332837c8423 | |
parent | ce048616a36da37c4ad4c070efbb59dbfff476a4 (diff) | |
download | gstreamer-plugins-bad-27ed14c3faf0c247b90f5e2f7b629fce8273a416.tar.gz |
mpegvideoparser: Fix the pixel-aspect-ratio calculation
Ignore the display_extension values if they are greater than the width/height
values provided by seqhdr and calculate the PAR based on the seqhdr values.T
his is what DVD players are doing.
Thanks to "David Schleef <ds@schleef.org>"
https://bugzilla.gnome.org/show_bug.cgi?id=685103
-rw-r--r-- | gst-libs/gst/codecparsers/gstmpegvideoparser.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gst-libs/gst/codecparsers/gstmpegvideoparser.c b/gst-libs/gst/codecparsers/gstmpegvideoparser.c index 2a5aa3b74..8c8b1a180 100644 --- a/gst-libs/gst/codecparsers/gstmpegvideoparser.c +++ b/gst-libs/gst/codecparsers/gstmpegvideoparser.c @@ -491,9 +491,14 @@ gst_mpeg_video_finalise_mpeg2_sequence_header (GstMpegVideoSequenceHdr * seqhdr, w = seqhdr->width; h = seqhdr->height; if (displayext) { - /* Use the display size for calculating PAR when display ext present */ - w = displayext->display_horizontal_size; - h = displayext->display_vertical_size; + /* Use the display size for calculating PAR when display ext present. + * But we are handling this like what DVD players are doing. Which means, + * ignore the display extension values if they are greater than the width/height + * values provided by seqhdr and calculate the PAR based on the seqhdr values. */ + if (displayext->display_horizontal_size < w) + w = displayext->display_horizontal_size; + if (displayext->display_vertical_size < h) + h = displayext->display_vertical_size; } /* Pixel_width = DAR_width * display_vertical_size */ |