Re: [FFmpeg-devel] [PATCH 1/2] avcodec/decode: don't reject flush packets when buffer_pkt is not empty

2023-07-12 Thread Anton Khirnov
Quoting James Almer (2023-07-12 13:30:30)
> On 7/12/2023 6:06 AM, Anton Khirnov wrote:
> > Quoting James Almer (2023-07-12 04:06:43)
> >> Restores the behavior pre commit a92dbeb9ae.
> >>
> >> Signed-off-by: James Almer 
> > 
> > Do you see any advantage to this?
> 
> Not returning an error when a flush packet is feed to the decoder. Why 
> would the API force me to retrieve frames before i can tell it I'm not 
> going to feed it any more packets?

Right, I guess that makes sense.
We should document this behaviour explicitly though, if we're bothering
to maintain it.

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/decode: don't reject flush packets when buffer_pkt is not empty

2023-07-12 Thread James Almer

On 7/12/2023 6:06 AM, Anton Khirnov wrote:

Quoting James Almer (2023-07-12 04:06:43)

Restores the behavior pre commit a92dbeb9ae.

Signed-off-by: James Almer 


Do you see any advantage to this?


Not returning an error when a flush packet is feed to the decoder. Why 
would the API force me to retrieve frames before i can tell it I'm not 
going to feed it any more packets?

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

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/decode: don't reject flush packets when buffer_pkt is not empty

2023-07-12 Thread Anton Khirnov
Quoting James Almer (2023-07-12 04:06:43)
> Restores the behavior pre commit a92dbeb9ae.
> 
> Signed-off-by: James Almer 

Do you see any advantage to this?

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 1/2] avcodec/decode: don't reject flush packets when buffer_pkt is not empty

2023-07-11 Thread James Almer
Restores the behavior pre commit a92dbeb9ae.

Signed-off-by: James Almer 
---
 libavcodec/decode.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index a47abeca06..239ad70b41 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -666,10 +666,9 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext 
*avctx, const AVPacke
 if (avpkt && !avpkt->size && avpkt->data)
 return AVERROR(EINVAL);
 
-if (!AVPACKET_IS_EMPTY(avci->buffer_pkt))
-return AVERROR(EAGAIN);
-
 if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
+if (!AVPACKET_IS_EMPTY(avci->buffer_pkt))
+return AVERROR(EAGAIN);
 ret = av_packet_ref(avci->buffer_pkt, avpkt);
 if (ret < 0)
 return ret;
-- 
2.41.0

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

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