adder: fill the audio-info that we use and not some random other one

This commit is contained in:
Stefan Sauer 2011-11-29 14:47:37 +01:00
parent 1cea9c851c
commit 089c760993

View file

@ -257,7 +257,6 @@ setcapsfunc (const GValue * item, IterData * data)
static gboolean static gboolean
gst_adder_setcaps (GstAdder * adder, GstPad * pad, GstCaps * caps) gst_adder_setcaps (GstAdder * adder, GstPad * pad, GstCaps * caps)
{ {
GstAudioInfo info;
GstIterator *it; GstIterator *it;
GstIteratorResult ires; GstIteratorResult ires;
IterData idata; IterData idata;
@ -298,10 +297,10 @@ gst_adder_setcaps (GstAdder * adder, GstPad * pad, GstCaps * caps)
GST_LOG_OBJECT (adder, "handle caps changes on pad %p,%s to %" GST_PTR_FORMAT, GST_LOG_OBJECT (adder, "handle caps changes on pad %p,%s to %" GST_PTR_FORMAT,
pad, GST_PAD_NAME (pad), caps); pad, GST_PAD_NAME (pad), caps);
if (!gst_audio_info_from_caps (&info, caps)) if (!gst_audio_info_from_caps (&adder->info, caps))
goto invalid_format; goto invalid_format;
switch (GST_AUDIO_INFO_FORMAT (&info)) { switch (GST_AUDIO_INFO_FORMAT (&adder->info)) {
case GST_AUDIO_FORMAT_S8: case GST_AUDIO_FORMAT_S8:
adder->func = (GstAdderFunction) add_int8; adder->func = (GstAdderFunction) add_int8;
break; break;
@ -1097,8 +1096,8 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
bpf = GST_AUDIO_INFO_BPF (&adder->info); bpf = GST_AUDIO_INFO_BPF (&adder->info);
GST_LOG_OBJECT (adder, GST_LOG_OBJECT (adder,
"starting to cycle through channels, %d bytes available (bps = %d)", "starting to cycle through channels, %d bytes available (bps = %d, bpf = %d)",
outsize, bpf); outsize, bps, bpf);
for (collected = pads->data; collected; collected = next) { for (collected = pads->data; collected; collected = next) {
GstCollectData *collect_data; GstCollectData *collect_data;