The branch, master has been updated
       via  09856e4e483f14125d38e5c84e908f623bb1a888 (commit)
      from  7b21bde34c4331b37a3e35832fb728e26c519bf4 (commit)


- Log -----------------------------------------------------------------
commit 09856e4e483f14125d38e5c84e908f623bb1a888
Author:     Zhao Zhili <[email protected]>
AuthorDate: Tue Sep 2 18:04:11 2025 +0800
Commit:     Zhao Zhili <[email protected]>
CommitDate: Mon Sep 8 20:43:07 2025 +0000

    doc/examples/vaapi_encode: fix invalid check on fwrite
    
    enc_pkt->size is 0 after av_packet_unref, which makes the check invalid.
    
    Fix regression from 3e4bfff2.
    
    Co-Authored-by: Jin Bo <[email protected]>
    Signed-off-by: Zhao Zhili <[email protected]>

diff --git a/doc/examples/vaapi_encode.c b/doc/examples/vaapi_encode.c
index ff3ebb1e2b..330a6524ef 100644
--- a/doc/examples/vaapi_encode.c
+++ b/doc/examples/vaapi_encode.c
@@ -88,7 +88,7 @@ static int encode_write(AVCodecContext *avctx, AVFrame 
*frame, FILE *fout)
         enc_pkt->stream_index = 0;
         ret = fwrite(enc_pkt->data, enc_pkt->size, 1, fout);
         av_packet_unref(enc_pkt);
-        if (ret != enc_pkt->size) {
+        if (!ret) {
             ret = AVERROR(errno);
             break;
         }

-----------------------------------------------------------------------

Summary of changes:
 doc/examples/vaapi_encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to