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>
pull/388/head
James Almer 2 years ago
parent 5b342d0005
commit 64007595dc
  1. 2
      libavcodec/mjpegbdec.c

@ -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) {

Loading…
Cancel
Save