Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/mjpegbdec: return the amount of bytes consumed when discarding frames
@ 2022-12-26 11:33 James Almer
  2022-12-27 13:43 ` James Almer
  0 siblings, 1 reply; 2+ messages in thread
From: James Almer @ 2022-12-26 11:33 UTC (permalink / raw)
  To: ffmpeg-devel

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>
---
 libavcodec/mjpegbdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index a82a95d70a..6d422e7a29 100644
--- a/libavcodec/mjpegbdec.c
+++ b/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) {
-- 
2.38.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/mjpegbdec: return the amount of bytes consumed when discarding frames
  2022-12-26 11:33 [FFmpeg-devel] [PATCH] avcodec/mjpegbdec: return the amount of bytes consumed when discarding frames James Almer
@ 2022-12-27 13:43 ` James Almer
  0 siblings, 0 replies; 2+ messages in thread
From: James Almer @ 2022-12-27 13:43 UTC (permalink / raw)
  To: ffmpeg-devel

On 12/26/2022 8:33 AM, James Almer wrote:
> 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>
> ---
>   libavcodec/mjpegbdec.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
> index a82a95d70a..6d422e7a29 100644
> --- a/libavcodec/mjpegbdec.c
> +++ b/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) {

Applied.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-27 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-26 11:33 [FFmpeg-devel] [PATCH] avcodec/mjpegbdec: return the amount of bytes consumed when discarding frames James Almer
2022-12-27 13:43 ` James Almer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git