+2006-08-16 Wim Taymans <wim@fluendo.com>
+
+ * ext/alsa/gstalsasink.c: (gst_alsasink_set_property),
+ (gst_alsasink_open):
+ * ext/alsa/gstalsasrc.c: (gst_alsasrc_set_property),
+ (gst_alsasrc_open):
+ Avoid setting and using a NULL device name.
+ Print more info when we fail to open a device.
+
2006-08-16 Tim-Philipp Müller <tim at centricular dot net>
* docs/libs/gst-plugins-base-libs-sections.txt:
switch (prop_id) {
case PROP_DEVICE:
- if (sink->device)
- g_free (sink->device);
- sink->device = g_strdup (g_value_get_string (value));
+ g_free (sink->device);
+ sink->device = g_value_dup_string (value);
+ /* setting NULL restores the default device */
+ if (sink->device == NULL) {
+ sink->device = g_strdup (DEFAULT_DEVICE);
+ }
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
open_error:
{
if (err == -EBUSY) {
- GST_ELEMENT_ERROR (alsa, RESOURCE, BUSY, (NULL), ("Device is busy"));
+ GST_ELEMENT_ERROR (alsa, RESOURCE, BUSY, (NULL), ("Device '%s' is busy",
+ alsa->device));
} else {
GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_WRITE,
- (NULL), ("Playback open error: %s", snd_strerror (err)));
+ (NULL), ("Playback open error on device '%s': %s", alsa->device,
+ snd_strerror (err)));
}
return FALSE;
}
case PROP_DEVICE:
g_free (src->device);
src->device = g_value_dup_string (value);
+ if (src->device == NULL) {
+ src->device = g_strdup (DEFAULT_PROP_DEVICE);
+ }
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
open_error:
{
if (err == -EBUSY) {
- GST_ELEMENT_ERROR (alsa, RESOURCE, BUSY, (NULL), (NULL));
+ GST_ELEMENT_ERROR (alsa, RESOURCE, BUSY, (NULL), ("Device '%s' is busy",
+ alsa->device));
} else {
- GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_READ,
- (NULL), ("Recording open error: %s", snd_strerror (err)));
+ GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_WRITE,
+ (NULL), ("Recording open error on device '%s': %s", alsa->device,
+ snd_strerror (err)));
}
return FALSE;
}