diff options
author | Andy Wingo <wingo@pobox.com> | 2002-02-17 02:06:04 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2002-02-17 02:06:04 +0000 |
commit | 6f2a22eb93ce68abf25a6c5845d6ac5322a09557 (patch) | |
tree | 134f8f1d01786d668dd17be3b60358a7428e6b94 /sys | |
parent | f194a20c0ba29568abbe1bfc53780e612de46338 (diff) |
better capsnego in osssink s/parseau/auparse/ update volume, mulawdecode, auparse to new capsnego
Original commit message from CVS:
* better capsnego in osssink
* s/parseau/auparse/
* update volume, mulawdecode, auparse to new capsnego
Diffstat (limited to 'sys')
-rw-r--r-- | sys/oss/gstosssink.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c index a225d203..433d5527 100644 --- a/sys/oss/gstosssink.c +++ b/sys/oss/gstosssink.c @@ -269,7 +269,8 @@ gst_osssink_sinkconnect (GstPad *pad, GstCaps *caps) if (width != depth) return GST_PAD_CONNECT_REFUSED; - osssink->bps = 0; + /* laws 1 and 2 are 1 bps anyway */ + osssink->bps = 1; law = gst_caps_get_int (caps, "law"); endianness = gst_caps_get_int (caps, "endianness"); @@ -300,6 +301,13 @@ gst_osssink_sinkconnect (GstPad *pad, GstCaps *caps) } osssink->bps = 1; } + } else if (law == 1) { + format = AFMT_MU_LAW; + } else if (law == 2) { + format = AFMT_A_LAW; + } else { + g_critical ("unknown law"); + return GST_PAD_CONNECT_REFUSED; } if (format == -1) @@ -416,6 +424,11 @@ gst_osssink_chain (GstPad *pad, GstBuffer *buf) buftime = GST_BUFFER_TIMESTAMP (buf); + if (!osssink->bps) { + gst_buffer_unref (buf); + gst_element_error (GST_ELEMENT (osssink), "capsnego was never performed, unknown data type"); + } + if (osssink->fd >= 0) { if (!osssink->mute) { guchar *data = GST_BUFFER_DATA (buf); |