jpegenc: Don't round up size of encoded buffers

For some reason, in code dating to 2001, encoded jpeg buffers were
rounded up to multiples of 4 bytes.  With the added bonus that the
extra bytes are unwritten, causing valgrind issues.  Oops.  I can't
think of any reason why JPEG buffers need to be multiples of 4 bytes,
so I removed the padding.  There might be some code somewhere that
depends on this behavior, so if this needs to be reverted, please fix
the valgrind issues.
This commit is contained in:
David Schleef 2011-06-29 14:39:52 -07:00
parent cc526d2e52
commit 2f94df8032

View file

@ -246,8 +246,7 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo)
/* Trim the buffer size and push it. */
GST_BUFFER_SIZE (jpegenc->output_buffer) =
GST_ROUND_UP_4 (GST_BUFFER_SIZE (jpegenc->output_buffer) -
jpegenc->jdest.free_in_buffer);
GST_BUFFER_SIZE (jpegenc->output_buffer) - jpegenc->jdest.free_in_buffer;
g_signal_emit (G_OBJECT (jpegenc), gst_jpegenc_signals[FRAME_ENCODED], 0);