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 18:54:14 +00:00
parent a680921560
commit a26984bd9d

View File

@ -379,13 +379,14 @@ gst_a52dec_loop (GstElement *element)
int i, length, flags, sample_rate, bit_rate; int i, length, flags, sample_rate, bit_rate;
int stream_channels; int stream_channels;
GstBuffer *buf; GstBuffer *buf;
guint8 got_bytes;
a52dec = GST_A52DEC (element); a52dec = GST_A52DEC (element);
/* find and read header */ /* find and read header */
while (1) { while (1) {
data = gst_bytestream_peek_bytes (a52dec->bs, 7); got_bytes = gst_bytestream_peek_bytes (a52dec->bs, &data, 7);
if (!data) { if (got_bytes < 7) {
gst_a52dec_handle_event (a52dec); gst_a52dec_handle_event (a52dec);
return; return;
} }
@ -418,8 +419,8 @@ gst_a52dec_loop (GstElement *element)
} }
/* read the header + rest of frame */ /* read the header + rest of frame */
buf = gst_bytestream_read (a52dec->bs, length); got_bytes = gst_bytestream_read (a52dec->bs, &buf, length);
if (!buf) { if (got_bytes < length) {
gst_a52dec_handle_event (a52dec); gst_a52dec_handle_event (a52dec);
return; return;
} }