summaryrefslogtreecommitdiffstats
path: root/gst/matroska/ebml-read.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-08-22 12:24:23 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-08-22 12:24:23 +0000
commit42998c9438cee485f9a9f5d3ed1c0be1d5ab4840 (patch)
treebef487fb42f76d430080e32fd5268b36c68572f1 /gst/matroska/ebml-read.c
parenta10d127c355c094aaa0c1890b001f9a833c926a7 (diff)
gst/matroska/ebml-read.c: Change some GST_ELEMENT_ERRORs to GST_ERROR_OBJECT to make it possible to ignore errors and...
Original commit message from CVS: * gst/matroska/ebml-read.c: (gst_ebml_read_element_id), (gst_ebml_read_element_length), (gst_ebml_read_uint), (gst_ebml_read_sint), (gst_ebml_read_float), (gst_ebml_read_header): Change some GST_ELEMENT_ERRORs to GST_ERROR_OBJECT to make it possible to ignore errors and not post any ERROR messages on the bus. * gst/matroska/matroska-demux.c: (gst_matroska_demux_parse_contents): Ignore any errors and not just EOS when parsing the contents of a SeekHead. Errors here are usually caused by truncated files and playback of the file works fine. Fixes playback of the audio_only_chapter_seekbroken.mka file from the MPlayer samples archive.
Diffstat (limited to 'gst/matroska/ebml-read.c')
-rw-r--r--gst/matroska/ebml-read.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/gst/matroska/ebml-read.c b/gst/matroska/ebml-read.c
index ae673ca5..bd7a71d3 100644
--- a/gst/matroska/ebml-read.c
+++ b/gst/matroska/ebml-read.c
@@ -329,9 +329,9 @@ gst_ebml_read_element_id (GstEbmlRead * ebml, guint32 * id, guint * level_up)
if (read > 4) {
guint64 pos = ebml->offset;
- GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid EBML ID size tag (0x%x) at position %" G_GUINT64_FORMAT
- " (0x%" G_GINT64_MODIFIER "x)", (guint) b, pos, pos));
+ GST_ERROR_OBJECT (ebml,
+ "Invalid EBML ID size tag (0x%x) at position %" G_GUINT64_FORMAT " (0x%"
+ G_GINT64_MODIFIER "x)", (guint) b, pos, pos);
return GST_FLOW_ERROR;
}
@@ -385,9 +385,9 @@ gst_ebml_read_element_length (GstEbmlRead * ebml, guint64 * length,
if (read > 8) {
guint64 pos = ebml->offset;
- GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid EBML length size tag (0x%x) at position %" G_GUINT64_FORMAT
- " (0x%" G_GINT64_MODIFIER "x)", (guint) b, pos, pos));
+ GST_ERROR_OBJECT (ebml,
+ "Invalid EBML length size tag (0x%x) at position %" G_GUINT64_FORMAT
+ " (0x%" G_GINT64_MODIFIER "x)", (guint) b, pos, pos);
return GST_FLOW_ERROR;
}
@@ -604,10 +604,9 @@ gst_ebml_read_uint (GstEbmlRead * ebml, guint32 * id, guint64 * num)
return ret;
if (size < 1 || size > 8) {
- GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid integer element size %d at position %" G_GUINT64_FORMAT
- " (0x%" G_GINT64_MODIFIER "x)",
- size, ebml->offset - size, ebml->offset - size));
+ GST_ERROR_OBJECT (ebml,
+ "Invalid integer element size %d at position %" G_GUINT64_FORMAT " (0x%"
+ G_GINT64_MODIFIER "x)", size, ebml->offset - size, ebml->offset - size);
return GST_FLOW_ERROR;
}
*num = 0;
@@ -637,10 +636,9 @@ gst_ebml_read_sint (GstEbmlRead * ebml, guint32 * id, gint64 * num)
return ret;
if (size < 1 || size > 8) {
- GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid integer element size %d at position %" G_GUINT64_FORMAT
- " (0x%" G_GINT64_MODIFIER "x)", size, ebml->offset - size,
- ebml->offset - size));
+ GST_ERROR_OBJECT (ebml,
+ "Invalid integer element size %d at position %" G_GUINT64_FORMAT " (0x%"
+ G_GINT64_MODIFIER "x)", size, ebml->offset - size, ebml->offset - size);
return GST_FLOW_ERROR;
}
@@ -715,10 +713,9 @@ gst_ebml_read_float (GstEbmlRead * ebml, guint32 * id, gdouble * num)
return ret;
if (size != 4 && size != 8 && size != 10) {
- GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, (NULL),
- ("Invalid float element size %d at position %" G_GUINT64_FORMAT
- " (0x%" G_GINT64_MODIFIER "x)", size, ebml->offset - size,
- ebml->offset - size));
+ GST_ERROR_OBJECT (ebml,
+ "Invalid float element size %d at position %" G_GUINT64_FORMAT " (0x%"
+ G_GINT64_MODIFIER "x)", size, ebml->offset - size, ebml->offset - size);
return GST_FLOW_ERROR;
}
@@ -887,7 +884,7 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
GST_DEBUG_OBJECT (ebml, "id: %08x", GST_READ_UINT32_BE (&id));
if (level_up != 0 || id != GST_EBML_ID_HEADER) {
- GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, (NULL), (NULL));
+ GST_ERROR_OBJECT (ebml, "Failed to read header");
return GST_FLOW_ERROR;
}
ret = gst_ebml_read_master (ebml, &id);
@@ -913,7 +910,8 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
return ret;
g_assert (id == GST_EBML_ID_EBMLREADVERSION);
if (num != GST_EBML_VERSION) {
- GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, (NULL), (NULL));
+ GST_ERROR_OBJECT (ebml, "Unsupported EBML version %" G_GUINT64_FORMAT,
+ num);
return GST_FLOW_ERROR;
}
@@ -930,7 +928,8 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
return ret;
g_assert (id == GST_EBML_ID_EBMLMAXSIZELENGTH);
if (num > sizeof (guint64)) {
- GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, (NULL), (NULL));
+ GST_ERROR_OBJECT (ebml,
+ "Unsupported EBML maximum size %" G_GUINT64_FORMAT, num);
return GST_FLOW_ERROR;
}
GST_DEBUG_OBJECT (ebml, "EbmlMaxSizeLength: %" G_GUINT64_FORMAT, num);
@@ -946,7 +945,8 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
return ret;
g_assert (id == GST_EBML_ID_EBMLMAXIDLENGTH);
if (num > sizeof (guint32)) {
- GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, (NULL), (NULL));
+ GST_ERROR_OBJECT (ebml,
+ "Unsupported EBML maximum ID %" G_GUINT64_FORMAT, num);
return GST_FLOW_ERROR;
}
GST_DEBUG_OBJECT (ebml, "EbmlMaxIdLength: %" G_GUINT64_FORMAT, num);