use new bytestream api. please test if you care about this plugin

Original commit message from CVS:
use new bytestream api. please test if you care about this plugin
This commit is contained in:
Steve Baker 2002-05-15 19:07:21 +00:00
parent 513dc268ef
commit 012aaa2cb0

View File

@ -250,9 +250,10 @@ gst_cdxa_parse_loop (GstElement *element)
if (cdxa_parse->state == CDXA_PARSE_HEADER) { if (cdxa_parse->state == CDXA_PARSE_HEADER) {
guint32 fmt_size; guint32 fmt_size;
guint8 *buf; guint8 *buf;
guint32 got_bytes;
header = (CDXAParseHeader *) gst_bytestream_peek_bytes (cdxa_parse->bs, 20); got_bytes = gst_bytestream_peek_bytes (cdxa_parse->bs, (guint8**)&header, 20);
if (!header) if (got_bytes < 20)
return; return;
cdxa_parse->riff_size = GUINT32_FROM_LE (header->riff_size); cdxa_parse->riff_size = GUINT32_FROM_LE (header->riff_size);
@ -263,8 +264,8 @@ gst_cdxa_parse_loop (GstElement *element)
return; return;
/* get the data size */ /* get the data size */
buf = gst_bytestream_peek_bytes (cdxa_parse->bs, 4); got_bytes = gst_bytestream_peek_bytes (cdxa_parse->bs, (guint8**)&buf, 4);
if (!buf) if (got_bytes < 4)
return; return;
cdxa_parse->data_size = GUINT32_FROM_LE (*((guint32 *)buf)); cdxa_parse->data_size = GUINT32_FROM_LE (*((guint32 *)buf));
@ -282,9 +283,10 @@ gst_cdxa_parse_loop (GstElement *element)
else { else {
GstBuffer *buf; GstBuffer *buf;
GstBuffer *outbuf; GstBuffer *outbuf;
guint32 got_bytes;
buf = gst_bytestream_read (cdxa_parse->bs, CDXA_SECTOR_SIZE); got_bytes = gst_bytestream_read (cdxa_parse->bs, &buf, CDXA_SECTOR_SIZE);
if (!buf) { if (got_bytes < CDXA_SECTOR_SIZE) {
gst_cdxa_parse_handle_event (cdxa_parse); gst_cdxa_parse_handle_event (cdxa_parse);
return; return;
} }