mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 06:16:36 +00:00
mad: If gst_pad_alloc_buffer() returns a buffer with the wrong size allocate a new one
Fixes bug #635461.
This commit is contained in:
parent
351595df34
commit
3dae13383d
1 changed files with 7 additions and 0 deletions
|
@ -1728,6 +1728,13 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
goto skip_frame;
|
goto skip_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GST_BUFFER_SIZE (outbuffer) != nsamples * mad->channels * 4) {
|
||||||
|
gst_buffer_unref (outbuffer);
|
||||||
|
|
||||||
|
outbuffer = gst_buffer_new_and_alloc (nsamples * mad->channels * 4);
|
||||||
|
gst_buffer_set_caps (outbuffer, GST_PAD_CAPS (mad->srcpad));
|
||||||
|
}
|
||||||
|
|
||||||
mad_synth_frame (&mad->synth, &mad->frame);
|
mad_synth_frame (&mad->synth, &mad->frame);
|
||||||
left_ch = mad->synth.pcm.samples[0];
|
left_ch = mad->synth.pcm.samples[0];
|
||||||
right_ch = mad->synth.pcm.samples[1];
|
right_ch = mad->synth.pcm.samples[1];
|
||||||
|
|
Loading…
Reference in a new issue