ffmpegdec: resize padding buffer when it's small

Only resize the padding buffer when the size is too small, when it's just right,
we don't need to call realloc.
This commit is contained in:
Wim Taymans 2009-04-17 19:07:26 +02:00
parent 11db4588a6
commit 010871cb77

View file

@ -2340,7 +2340,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
if (ffmpegdec->do_padding) {
/* add padding */
if (ffmpegdec->padded_size <= size + FF_INPUT_BUFFER_PADDING_SIZE) {
if (ffmpegdec->padded_size < size + FF_INPUT_BUFFER_PADDING_SIZE) {
ffmpegdec->padded_size = size + FF_INPUT_BUFFER_PADDING_SIZE;
ffmpegdec->padded =
g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);