From c622ee22a845296ab4454fc3ad8173f015148380 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Wed, 15 May 2002 19:05:41 +0000 Subject: 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 --- ext/dv/gstdvdec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/dv/gstdvdec.c') diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index e2acb470..36f8418f 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -271,12 +271,13 @@ gst_dvdec_loop (GstElement *element) gint outframe_pitches[3]; gboolean PAL; gint height; + guint32 length, got_bytes; dvdec = GST_DVDEC (element); /* first read enough bytes to parse the header */ - inframe = gst_bytestream_peek_bytes (dvdec->bs, header_size); - if (!inframe) { + got_bytes = gst_bytestream_peek_bytes (dvdec->bs, &inframe, header_size); + if (got_bytes < header_size) { gst_dvdec_handle_event (dvdec); return; } @@ -285,10 +286,11 @@ gst_dvdec_loop (GstElement *element) PAL = dv_system_50_fields (dvdec->decoder); height = (PAL ? PAL_HEIGHT : NTSC_HEIGHT); + length = (PAL ? PAL_BUFFER : NTSC_BUFFER); /* then read the read data */ - buf = gst_bytestream_read (dvdec->bs, (PAL ? PAL_BUFFER : NTSC_BUFFER)); - if (!buf) { + got_bytes = gst_bytestream_read (dvdec->bs, &buf, length); + if (got_bytes < length) { gst_dvdec_handle_event (dvdec); return; } -- cgit