summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-10-26 12:16:43 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-10-26 12:16:43 +0000
commit5d540ce92409a96a47f706c5e3e4d7d067c3fc86 (patch)
tree61bebf447a223d9985b4be97ea0f5da0086752b1 /sys
parent5de12607be5c4579d5d3920a4e7394c6e901705f (diff)
Rename osselement to ossmixer and only open audio device if we have at least one pad. This makes ossmixer *only* open...
Original commit message from CVS: Rename osselement to ossmixer and only open audio device if we have at least one pad. This makes ossmixer *only* open the mixer, which means we can open multiple mixer sessions.
Diffstat (limited to 'sys')
-rw-r--r--sys/oss/gstosselement.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/oss/gstosselement.c b/sys/oss/gstosselement.c
index 6773ea74..e4ac82a9 100644
--- a/sys/oss/gstosselement.c
+++ b/sys/oss/gstosselement.c
@@ -412,6 +412,8 @@ gst_osselement_open_audio (GstOssElement *oss)
if (GST_PAD_IS_SINK (firstpad)) {
mode = GST_OSSELEMENT_WRITE;
}
+ } else {
+ goto do_mixer;
}
/* first try to open the sound card */
@@ -515,6 +517,7 @@ gst_osselement_open_audio (GstOssElement *oss)
oss->caps = caps;
+do_mixer:
gst_ossmixer_build_list (oss);
return TRUE;
@@ -523,10 +526,11 @@ gst_osselement_open_audio (GstOssElement *oss)
static void
gst_osselement_close_audio (GstOssElement *oss)
{
+ gst_ossmixer_free_list (oss);
+
if (oss->fd < 0)
return;
- gst_ossmixer_free_list (oss);
close(oss->fd);
oss->fd = -1;
}
@@ -678,7 +682,7 @@ gst_osselement_factory_init (GstPlugin *plugin)
{
GstElementFactory *factory;
- factory = gst_element_factory_new ("osselement",
+ factory = gst_element_factory_new ("ossmixer",
GST_TYPE_OSSELEMENT,
&gst_osselement_details);
g_return_val_if_fail (factory != NULL, FALSE);