summaryrefslogtreecommitdiffstats
path: root/sys/oss/gstosssrc.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-04-04 21:02:18 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-04-04 21:02:18 +0000
commitcb0e1dd5d8ee69c1e70562b5ad096d5e08d9c95c (patch)
treeebbbc4abff7e2ce02daafe1a0ec4761d6c1aa9cc /sys/oss/gstosssrc.c
parent8307214acf6d102c7495976ee80f8b78efa7080f (diff)
I'm too lazy to comment this
Original commit message from CVS: Fix #106709 - waiting for approval in 0.6.1 - patch thanks to Peter N Lundblad <lundblad@linux.nu>
Diffstat (limited to 'sys/oss/gstosssrc.c')
-rw-r--r--sys/oss/gstosssrc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/oss/gstosssrc.c b/sys/oss/gstosssrc.c
index 748bfb4f..db810f59 100644
--- a/sys/oss/gstosssrc.c
+++ b/sys/oss/gstosssrc.c
@@ -306,6 +306,20 @@ gst_osssrc_get (GstPad *pad)
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) {
@@ -321,20 +335,6 @@ gst_osssrc_get (GstPad *pad)
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));
- }
-
GST_BUFFER_SIZE (buf) = readbytes;
GST_BUFFER_OFFSET (buf) = src->curoffset;