summaryrefslogtreecommitdiffstats
path: root/gst/matroska/ebml-read.c
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2008-03-03 22:01:56 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-03-03 22:01:56 +0000
commitedda3b6c0f721bb2085de7e76abf761b3f691326 (patch)
tree30596ea2654c056f48c619492bce176294f0705b /gst/matroska/ebml-read.c
parentb7938d24ee5c45fcf17b9987bb88f698430c529e (diff)
gst/matroska/ebml-read.c: Use GINT64 formatting constants from GLIB.
Original commit message from CVS: * gst/matroska/ebml-read.c: Use GINT64 formatting constants from GLIB. * gst/matroska/matroska-demux.c: Add some guards to avoid a possible division by 0 and crashing with NULL events on some systems. Use gst_gdouble_to_guint64 somewhere instead of an implicit conversion. * gst/matroska/matroska-mux.c: Check for invalid timestamps in a bunch of places to avoid writing bogus durations into the output file. Fix some double<->gint64 conversions that weren't using gst_guint64_to_gdouble
Diffstat (limited to 'gst/matroska/ebml-read.c')
-rw-r--r--gst/matroska/ebml-read.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gst/matroska/ebml-read.c b/gst/matroska/ebml-read.c
index 83439104..9c5ae4a6 100644
--- a/gst/matroska/ebml-read.c
+++ b/gst/matroska/ebml-read.c
@@ -266,8 +266,8 @@ gst_ebml_read_element_id (GstEbmlRead * ebml, guint32 * id, guint * level_up)
guint64 pos = ebml->offset;
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid EBML ID size tag (0x%x) at position %llu (0x%llx)",
- (guint) b, pos, pos));
+ ("Invalid EBML ID size tag (0x%x) at position %" G_GUINT64_FORMAT
+ " (0x%" G_GINT64_MODIFIER "x)", (guint) b, pos, pos));
return FALSE;
}
@@ -318,8 +318,8 @@ gst_ebml_read_element_length (GstEbmlRead * ebml, guint64 * length)
guint64 pos = ebml->offset;
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid EBML length size tag (0x%x) at position %llu (0x%llx)",
- (guint) b, pos, pos));
+ ("Invalid EBML length size tag (0x%x) at position %" G_GUINT64_FORMAT
+ " (0x%" G_GINT64_MODIFIER "x)", (guint) b, pos, pos));
return -1;
}
@@ -498,7 +498,8 @@ gst_ebml_read_uint (GstEbmlRead * ebml, guint32 * id, guint64 * num)
if (size < 1 || size > 8) {
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid integer element size %d at position %llu (0x%llu)",
+ ("Invalid integer element size %d at position %" G_GUINT64_FORMAT
+ " (0x%" G_GINT64_MODIFIER "x)",
size, ebml->offset - size, ebml->offset - size));
return FALSE;
}
@@ -528,8 +529,9 @@ gst_ebml_read_sint (GstEbmlRead * ebml, guint32 * id, gint64 * num)
if (size < 1 || size > 8) {
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid integer element size %d at position %llu (0x%llx)",
- size, ebml->offset - size, ebml->offset - size));
+ ("Invalid integer element size %d at position %" G_GUINT64_FORMAT
+ " (0x%" G_GINT64_MODIFIER "x)", size, ebml->offset - size,
+ ebml->offset - size));
return FALSE;
}
@@ -570,8 +572,9 @@ gst_ebml_read_float (GstEbmlRead * ebml, guint32 * id, gdouble * num)
if (size != 4 && size != 8 && size != 10) {
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid float element size %d at position %llu (0x%llx)",
- size, ebml->offset - size, ebml->offset - size));
+ ("Invalid float element size %d at position %" G_GUINT64_FORMAT
+ " (0x%" G_GINT64_MODIFIER "x)", size, ebml->offset - size,
+ ebml->offset - size));
return FALSE;
}