GstByteReader *br = gst_ebml_read_br (ebml);
guint size = gst_byte_reader_get_remaining (br);
- gst_byte_reader_peek_data (br, size, &data);
+ if (gst_byte_reader_peek_data (br, size, &data)) {
- GST_LOG_OBJECT (ebml->el, "current br %p; remaining %d", br, size);
- if (data)
- GST_MEMDUMP_OBJECT (ebml->el, "element", data, MIN (size, *length));
+ GST_LOG_OBJECT (ebml->el, "current br %p; remaining %d", br, size);
+ if (data)
+ GST_MEMDUMP_OBJECT (ebml->el, "element", data, MIN (size, *length));
+ }
}
#endif
gst_buffer_map (buf, &map, GST_MAP_READ);
buf_data = map.data;
}
- gst_byte_writer_put_data (ebml->streamheader, buf_data, data_size);
+ if (!gst_byte_writer_put_data (ebml->streamheader, buf_data, data_size))
+ GST_WARNING ("Error writing data to streamheader");
}
if (ebml->cache) {
if (!buf_data) {
gst_buffer_map (buf, &map, GST_MAP_READ);
buf_data = map.data;
}
- gst_byte_writer_put_data (ebml->cache, buf_data, data_size);
+ if (!gst_byte_writer_put_data (ebml->cache, buf_data, data_size))
+ GST_WARNING ("Error writing data to cache");
if (map.data)
gst_buffer_unmap (buf, &map);
gst_buffer_unref (buf);
if (cluster_pos >= 0) {
newpos += cluster_pos;
/* prepare resuming at next byte */
- gst_byte_reader_skip (&reader, cluster_pos + 1);
+ if (!gst_byte_reader_skip (&reader, cluster_pos + 1)) {
+ GST_DEBUG_OBJECT (demux, "Need more data -> continue");
+ continue;
+ }
GST_DEBUG_OBJECT (demux,
"found cluster ebml id at offset %" G_GINT64_FORMAT, newpos);
/* extra checks whether we really sync'ed to a cluster: