summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/audiofile/gstafsink.c5
-rw-r--r--ext/musicbrainz/gsttrm.c22
-rw-r--r--ext/smoothwave/gstsmoothwave.c2
3 files changed, 16 insertions, 13 deletions
diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c
index 872864b2..6d004ccb 100644
--- a/ext/audiofile/gstafsink.c
+++ b/ext/audiofile/gstafsink.c
@@ -302,12 +302,15 @@ gst_afsink_open_file (GstAFSink * sink)
if (caps == NULL) {
g_critical ("gstafsink chain : Could not get caps of pad !\n");
} else {
+ gint rate = 0;
+
structure = gst_caps_get_structure (caps, 0);
gst_structure_get_int (structure, "channels", &sink->channels);
gst_structure_get_int (structure, "width", &sink->width);
- gst_structure_get_int (structure, "rate", &sink->rate);
+ gst_structure_get_int (structure, "rate", &rate);
gst_structure_get_boolean (structure, "signed", &sink->is_signed);
gst_structure_get_int (structure, "endianness", &sink->endianness_data);
+ sink->rate = rate;
}
GST_DEBUG ("channels %d, width %d, rate %d, signed %s",
sink->channels, sink->width, sink->rate, sink->is_signed ? "yes" : "no");
diff --git a/ext/musicbrainz/gsttrm.c b/ext/musicbrainz/gsttrm.c
index 85939f9f..fb310326 100644
--- a/ext/musicbrainz/gsttrm.c
+++ b/ext/musicbrainz/gsttrm.c
@@ -176,7 +176,7 @@ gst_musicbrainz_sinkconnect (GstPad * pad, const GstCaps * caps)
GstMusicBrainz *musicbrainz;
GstStructure *structure;
const gchar *mimetype;
- gint width;
+ gint width, depth, chans, rate;
musicbrainz = GST_MUSICBRAINZ (gst_pad_get_parent (pad));
@@ -185,18 +185,18 @@ gst_musicbrainz_sinkconnect (GstPad * pad, const GstCaps * caps)
structure = gst_caps_get_structure (caps, 0);
mimetype = gst_structure_get_name (structure);
- if (!gst_structure_get_int (structure, "depth", &musicbrainz->depth) ||
- !gst_structure_get_int (structure, "width", &width))
+ if (!gst_structure_get_int (structure, "depth", &depth) ||
+ !gst_structure_get_int (structure, "width", &width) ||
+ !gst_structure_get_int (structure, "channels", &chans) ||
+ !gst_structure_get_int (structure, "rate", &rate))
return GST_PAD_LINK_REFUSED;
- if (musicbrainz->depth != width)
+ if (depth != width)
return GST_PAD_LINK_REFUSED;
- if (!gst_structure_get_int (structure, "channels", &musicbrainz->channels))
- return GST_PAD_LINK_REFUSED;
-
- if (!gst_structure_get_int (structure, "rate", &musicbrainz->rate))
- return GST_PAD_LINK_REFUSED;
+ musicbrainz->rate = rate;
+ musicbrainz->depth = depth;
+ musicbrainz->channels = chans;
trm_SetPCMDataInfo (musicbrainz->trm, musicbrainz->rate,
musicbrainz->channels, musicbrainz->depth);
@@ -272,8 +272,8 @@ gst_musicbrainz_chain (GstPad * pad, GstData * data)
}
if (!musicbrainz->signature_available
- && trm_GenerateSignature (musicbrainz->trm, GST_BUFFER_DATA (buf),
- GST_BUFFER_SIZE (buf))) {
+ && trm_GenerateSignature (musicbrainz->trm,
+ (gchar *) GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf))) {
GST_DEBUG ("Signature");
if (musicbrainz->proxy_address != NULL) {
diff --git a/ext/smoothwave/gstsmoothwave.c b/ext/smoothwave/gstsmoothwave.c
index 2583a4db..de440f59 100644
--- a/ext/smoothwave/gstsmoothwave.c
+++ b/ext/smoothwave/gstsmoothwave.c
@@ -314,7 +314,7 @@ gst_smoothwave_chain (GstPad * pad, GstData * _data)
gint i;
gint qheight;
const gint16 *samples =
- (const guint16 *) gst_adapter_peek (smoothwave->adapter, bytesperread);
+ (const gint16 *) gst_adapter_peek (smoothwave->adapter, bytesperread);
gint stride = smoothwave->width;
/* First draw the new waveform */