gst_modplug_fixate (GstPad * pad, GstCaps * caps)
{
GstStructure *structure;
+
+ GST_DEBUG_OBJECT (pad, "Fixating caps: %"GST_PTR_FORMAT, caps);
structure = gst_caps_get_structure (caps, 0);
if (!gst_structure_fixate_field_nearest_int (structure, "rate", 44100))
gst_structure_get_int (structure, "depth", &modplug->bits);
gst_structure_get_int (structure, "channels", &modplug->channel);
gst_structure_get_int (structure, "rate", &modplug->frequency);
+
+ GST_DEBUG_OBJECT (modplug,
+ "Audio settings: %d bits, %d channel(s), %d Hz sampling rate",
+ modplug->bits, modplug->channel, modplug->frequency);
gst_pad_set_caps (modplug->srcpad, newcaps);
gst_caps_unref (newcaps);
GST_TAG_COMMENT, comment, NULL);
}
-
gst_element_found_tags (GST_ELEMENT (modplug), tags);
} else {
/* not fully loaded yet */
gfloat temp;
temp = (gfloat) modplug->song_length / modplug->seek_at;
- seek_to_pos = (int) (modplug->mSoundFile->GetMaxPosition () / temp);
+ seek_to_pos = (gint) (modplug->mSoundFile->GetMaxPosition () / temp);
GST_DEBUG_OBJECT (modplug, "Seeking to row %d", seek_to_pos);
}
/* read and output a buffer */
+ GST_LOG_OBJECT (modplug, "Read %d bytes", (gint)modplug->read_bytes);
+ /* libmodplug 0.8.7 trashes memory */
flow = gst_pad_alloc_buffer_and_set_caps (modplug->srcpad,
- GST_BUFFER_OFFSET_NONE, modplug->read_bytes,
+ GST_BUFFER_OFFSET_NONE, modplug->read_bytes * 2,
GST_PAD_CAPS (modplug->srcpad), &out);
+ GST_BUFFER_SIZE (out) = modplug->read_bytes;
if (flow != GST_FLOW_OK) {
GST_LOG_OBJECT (modplug, "pad alloc flow: %s", gst_flow_get_name (flow));