diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-30 04:07:51 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-01 16:12:14 +0200 |
commit | 9b3279b20198a46aae08c29c3b4c4ce75ff637ff (patch) | |
tree | b6744f3ddae395b8dfb8318bddfa8a99e9cd8c9b /libavcodec/ljpegenc.c | |
parent | f7d44804a6fe5c3ce29464553411e184eea6461a (diff) | |
download | ffmpeg-9b3279b20198a46aae08c29c3b4c4ce75ff637ff.tar.gz |
avcodec/mjpegenc: Fix files with slices > 1, but threads == 1
In the aforementioned case mpegvideo_enc.c calls
ff_mjpeg_encode_stuffing() at the end of every line which
pads the output to byte-alignment and escapes it;
yet it does not write the restart-markers (and also not
the DRI marker when writing the header) and so the output files
are broken.
Fix this by writing these markers depending upon the number of
slices and not the number of threads in use; this also makes
the output of the encoder reproducible given a slice count
and is therefore important if encoder tests that actually use
-threads auto are added in the future.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/ljpegenc.c')
-rw-r--r-- | libavcodec/ljpegenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c index fad19cbb76..1af4475b75 100644 --- a/libavcodec/ljpegenc.c +++ b/libavcodec/ljpegenc.c @@ -239,7 +239,7 @@ static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, init_put_bits(&pb, pkt->data, pkt->size); ff_mjpeg_encode_picture_header(avctx, &pb, NULL, &s->scantable, - s->pred, s->matrix, s->matrix); + s->pred, s->matrix, s->matrix, 0); header_bits = put_bits_count(&pb); |