From 65fdbe68ecf67a5c4f7ea3a7cdf66628c8e42db5 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 13 Jul 2010 12:34:44 +0200 Subject: [PATCH] qtdemux: also calculate PAR using track width and height for QT files (... as opposed to only for ISO style files). Fixes #624173. --- gst/qtdemux/qtdemux.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 9f6d08b2da..63d9acaba5 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -3969,25 +3969,22 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux, "height", G_TYPE_INT, stream->height, "framerate", GST_TYPE_FRACTION, stream->fps_n, stream->fps_d, NULL); - /* iso files: - * calculate pixel-aspect-ratio using display width and height */ - if (qtdemux->major_brand != FOURCC_qt__) { - GST_DEBUG_OBJECT (qtdemux, - "video size %dx%d, target display size %dx%d", stream->width, - stream->height, stream->display_width, stream->display_height); + /* calculate pixel-aspect-ratio using display width and height */ + GST_DEBUG_OBJECT (qtdemux, + "video size %dx%d, target display size %dx%d", stream->width, + stream->height, stream->display_width, stream->display_height); - if (stream->display_width > 0 && stream->display_height > 0 && - stream->width > 0 && stream->height > 0) { - gint n, d; + if (stream->display_width > 0 && stream->display_height > 0 && + stream->width > 0 && stream->height > 0) { + gint n, d; - /* calculate the pixel aspect ratio using the display and pixel w/h */ - n = stream->display_width * stream->height; - d = stream->display_height * stream->width; - if (n != d) { - GST_DEBUG_OBJECT (qtdemux, "setting PAR to %d/%d", n, d); - gst_caps_set_simple (stream->caps, "pixel-aspect-ratio", - GST_TYPE_FRACTION, n, d, NULL); - } + /* calculate the pixel aspect ratio using the display and pixel w/h */ + n = stream->display_width * stream->height; + d = stream->display_height * stream->width; + if (n != d) { + GST_DEBUG_OBJECT (qtdemux, "setting PAR to %d/%d", n, d); + gst_caps_set_simple (stream->caps, "pixel-aspect-ratio", + GST_TYPE_FRACTION, n, d, NULL); } }