From: Ronald B. <rb...@us...> - 2003-04-04 21:02:32
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: rbultje Date: Fri Apr 04 2003 13:02:32 PST Log message: Fix #106709 - waiting for approval in 0.6.1 - patch thanks to Peter N Lundblad <lun...@li...> 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.28&r2=1.29 ====Begin Diffs==== Index: gstosssrc.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/sys/oss/gstosssrc.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- gstosssrc.c 30 Mar 2003 21:19:08 -0000 1.28 +++ gstosssrc.c 4 Apr 2003 21:02:18 -0000 1.29 @@ -306,6 +306,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) { @@ -318,20 +332,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)); } |