guint8 *pos, *end;
guint8 type;
guint16 packet_len;
+ gint remaining;
gst_buffer_map (buf, &map, GST_MAP_READ);
pos += 2;
if (pos + packet_len > end) {
- gst_buffer_unmap (buf, &map);
PGS_DUMP ("Invalid packet length %u (only have %u bytes)\n", packet_len,
end - pos);
goto error;
} while (pos + 3 <= end);
PGS_DUMP ("End dumping command buffer with %u bytes remaining\n", end - pos);
- return (pos - map.data);
+ remaining = (gint) (pos - map.data);
+ gst_buffer_unmap (buf, &map);
+ return remaining;
/* ERRORS */
error:
gboolean
gstspu_pgs_handle_dvd_event (GstDVDSpu * dvdspu, GstEvent * event)
{
+ gst_event_unref (event);
return FALSE;
}