From: Ronald B. <rb...@us...> - 2003-04-07 16:56:23
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: rbultje Date: Mon Apr 07 2003 09:56:20 PDT Branch: BRANCH-GSTREAMER-0_6 Log message: Fixes #106709 Modified files: sys/oss : gstosssrc.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/oss/gstosssrc.c.diff?r1=1.25.4.1&r2=1.25.4.2 ====Begin Diffs==== Index: gstosssrc.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/sys/oss/gstosssrc.c,v retrieving revision 1.25.4.1 retrieving revision 1.25.4.2 diff -u -d -r1.25.4.1 -r1.25.4.2 --- gstosssrc.c 28 Jan 2003 10:50:06 -0000 1.25.4.1 +++ gstosssrc.c 7 Apr 2003 16:56:05 -0000 1.25.4.2 @@ -258,6 +258,20 @@ buf = gst_buffer_new_and_alloc (src->buffersize); + if (!GST_PAD_CAPS (pad)) { + /* nothing was negotiated, we can decide on a format */ + if (!gst_osssrc_negotiate (pad)) { + gst_buffer_unref (buf); + gst_element_error (GST_ELEMENT (src), "could not negotiate format"); + return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT)); + } + } + if (src->common.bps == 0) { + gst_buffer_unref (buf); + gst_element_error (GST_ELEMENT (src), "no format negotiated"); + return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT)); + } + readbytes = read (src->common.fd,GST_BUFFER_DATA (buf), src->buffersize); if (readbytes < 0) { @@ -270,20 +284,6 @@ if (readbytes == 0) { gst_buffer_unref (buf); gst_element_set_eos (GST_ELEMENT (src)); - return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT)); - } - - if (!GST_PAD_CAPS (pad)) { - /* nothing was negotiated, we can decide on a format */ - if (!gst_osssrc_negotiate (pad)) { - gst_buffer_unref (buf); - gst_element_error (GST_ELEMENT (src), "could not negotiate format"); - return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT)); - } - } - if (src->common.bps == 0) { - gst_buffer_unref (buf); - gst_element_error (GST_ELEMENT (src), "no format negotiated"); return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT)); } |