avcodec/mjpegbdec: return the amount of bytes consumed when discarding frames

EAGAIN is not correct in this scenario. FFCodec.cb.decode() callback decoders
always return the amount of bytes consumed from the input packet (if any), and
report if a frame was generated by setting got_frame.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2022-12-26 08:30:41 -03:00
parent 5b342d0005
commit 64007595dc

View File

@ -144,7 +144,7 @@ read_header:
av_frame_move_ref(rframe, s->picture_ptr);
s->got_picture = 0;
if (avctx->skip_frame == AVDISCARD_ALL)
return AVERROR(EAGAIN);
return buf_size;
*got_frame = 1;
if (!s->lossless && avctx->debug & FF_DEBUG_QP) {