gst/qtdemux/qtdemux.c: Revert ISO base media spec based pixel-aspect-ratio calculation.

Original commit message from CVS:
* gst/qtdemux/qtdemux.c: (gst_qtdemux_add_stream),
(qtdemux_parse_trak):
Revert ISO base media spec based pixel-aspect-ratio calculation.
Fixes #543300.
This commit is contained in:
Mark Nauwelaerts 2008-07-18 20:03:07 +00:00
parent 4511fdb05d
commit 964f855f8b
2 changed files with 7 additions and 32 deletions

View file

@ -1,3 +1,10 @@
2008-07-18 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
* gst/qtdemux/qtdemux.c: (gst_qtdemux_add_stream),
(qtdemux_parse_trak):
Revert ISO base media spec based pixel-aspect-ratio calculation.
Fixes #543300.
2008-07-17 Edward Hervey <edward.hervey@collabora.co.uk>
* sys/osxvideo/osxvideosink.m:

View file

@ -136,9 +136,6 @@ struct _QtDemuxStream
/* video info */
gint width;
gint height;
/* aspect ratio */
gint display_width;
gint display_height;
/* Numerator/denominator framerate */
gint fps_n;
gint fps_d;
@ -2675,25 +2672,6 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux,
"height", G_TYPE_INT, stream->height,
"framerate", GST_TYPE_FRACTION, stream->fps_n, stream->fps_d, NULL);
/* 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;
/* 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);
}
}
depth = stream->bits_per_sample;
/* more than 32 bits means grayscale */
@ -3273,8 +3251,6 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
if (stream->subtype == FOURCC_vide) {
guint32 fourcc;
const guint8 *tkhd_data = (const guint8 *) tkhd->data;
guint8 version;
stream->sampled = TRUE;
@ -3293,14 +3269,6 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
GST_LOG_OBJECT (qtdemux, "frame count: %u",
QT_UINT16 (stsd_data + offset + 48));
version = QT_UINT8 (tkhd_data + 8);
if (version == 1)
offset = 96;
else
offset = 84;
stream->display_width = (guint) QT_FP32 (tkhd_data + offset);
stream->display_height = (guint) QT_FP32 (tkhd_data + offset + 4);
if (fourcc == FOURCC_drms)
goto error_encrypted;