ext/esd/esdsink.c (gst_esdsink_getcaps): Seems that wierd va_list caps setting function was borked. Fixed esdsink.

Original commit message from CVS:
2005-08-08  Andy Wingo  <wingo@pobox.com>

* ext/esd/esdsink.c (gst_esdsink_getcaps): Seems that wierd
va_list caps setting function was borked. Fixed esdsink.
This commit is contained in:
Andy Wingo 2005-08-08 17:27:28 +00:00
parent 568194ce35
commit 71de30e469
2 changed files with 12 additions and 25 deletions

View file

@ -1,5 +1,8 @@
2005-08-08 Andy Wingo <wingo@pobox.com> 2005-08-08 Andy Wingo <wingo@pobox.com>
* ext/esd/esdsink.c (gst_esdsink_getcaps): Seems that wierd
va_list caps setting function was borked. Fixed esdsink.
* sys/oss/gstosssink.c (gst_oss_sink_open, gst_oss_sink_close) * sys/oss/gstosssink.c (gst_oss_sink_open, gst_oss_sink_close)
(gst_oss_sink_prepare, gst_oss_sink_unprepare): Update for newer (gst_oss_sink_prepare, gst_oss_sink_unprepare): Update for newer
audiosink api. audiosink api.

View file

@ -176,34 +176,13 @@ gst_esdsink_dispose (GObject * object)
G_OBJECT_CLASS (parent_class)->dispose (object); G_OBJECT_CLASS (parent_class)->dispose (object);
} }
#define IS_WRITABLE(caps) \
(g_atomic_int_get (&(caps)->refcount) == 1)
void
gst_caps_set_each (GstCaps * caps, char *field, ...)
{
GstStructure *structure;
va_list var_args;
int i;
g_return_if_fail (GST_IS_CAPS (caps));
g_return_if_fail (IS_WRITABLE (caps));
va_start (var_args, field);
for (i = 0; i < caps->structs->len; i++) {
structure = gst_caps_get_structure (caps, i);
gst_structure_set_valist (structure, field, var_args);
}
va_end (var_args);
}
static GstCaps * static GstCaps *
gst_esdsink_getcaps (GstBaseSink * bsink) gst_esdsink_getcaps (GstBaseSink * bsink)
{ {
GstEsdSink *esdsink; GstEsdSink *esdsink;
GstPadTemplate *pad_template; GstPadTemplate *pad_template;
GstCaps *caps = NULL; GstCaps *caps = NULL;
gint i;
esd_server_info_t *server_info; esd_server_info_t *server_info;
GST_DEBUG ("getcaps called"); GST_DEBUG ("getcaps called");
@ -221,10 +200,15 @@ gst_esdsink_getcaps (GstBaseSink * bsink)
if (server_info) { if (server_info) {
GST_DEBUG ("got server info rate: %i", server_info->rate); GST_DEBUG ("got server info rate: %i", server_info->rate);
g_print ("hey\n"); for (i = 0; i < caps->structs->len; i++) {
gst_caps_set_each (caps, "rate", G_TYPE_INT, server_info->rate, NULL); GstStructure *s;
g_print ("ho\n");
s = gst_caps_get_structure (caps, i);
gst_structure_set (s, "rate", G_TYPE_INT, server_info->rate, NULL);
}
esd_free_server_info (server_info); esd_free_server_info (server_info);
return caps; return caps;
} else { } else {
GST_WARNING_OBJECT (esdsink, "couldn't get server info!"); GST_WARNING_OBJECT (esdsink, "couldn't get server info!");