ext/ogg/gstogmparse.c: GST_TYPE_FRACTION contains gints so correctly cast gint64 arguments to vaargs functions to gin...

Original commit message from CVS:
* ext/ogg/gstogmparse.c: (gst_ogm_parse_stream_header):
GST_TYPE_FRACTION contains gints so correctly cast gint64 arguments to
vaargs functions to gint. Otherwise the fractions will get 0 set
instead of the correct value on big endian systems. Fixes bug #529018.
This commit is contained in:
Sebastian Dröge 2008-04-20 11:42:37 +00:00
parent fb2dc81a97
commit 9587e5e1c0
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2008-04-20 Sebastian Dröge <slomo@circular-chaos.org>
* ext/ogg/gstogmparse.c: (gst_ogm_parse_stream_header):
GST_TYPE_FRACTION contains gints so correctly cast gint64 arguments to
vaargs functions to gint. Otherwise the fractions will get 0 set
instead of the correct value on big endian systems. Fixes bug #529018.
2008-04-20 Sebastian Dröge <slomo@circular-chaos.org>
* ext/gnomevfs/gstgnomevfssink.c:

View file

@ -577,6 +577,7 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size)
}
case 'v':{
guint32 fourcc;
gint time_unit;
fourcc = GST_MAKE_FOURCC (ogm->hdr.subtype[0],
ogm->hdr.subtype[1], ogm->hdr.subtype[2], ogm->hdr.subtype[3]);
@ -601,10 +602,15 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size)
ogm->hdr.samples_per_unit, ogm->hdr.default_len,
ogm->hdr.buffersize, ogm->hdr.bits_per_sample, caps);
/* GST_TYPE_FRACTION contains gint */
if (ogm->hdr.time_unit > G_MAXINT || ogm->hdr.time_unit < G_MININT)
GST_WARNING_OBJECT (ogm, "timeunit is out of range");
time_unit = (gint) CLAMP (ogm->hdr.time_unit, G_MININT, G_MAXINT);
gst_caps_set_simple (caps,
"width", G_TYPE_INT, ogm->hdr.s.video.width,
"height", G_TYPE_INT, ogm->hdr.s.video.height,
"framerate", GST_TYPE_FRACTION, 10000000, ogm->hdr.time_unit, NULL);
"framerate", GST_TYPE_FRACTION, 10000000, time_unit, NULL);
break;
}
case 't':{