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.
/* 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);