Re: [PATCH 2/6] gui: Use new lavc decode API for PNG decode.

Ingo Brückl <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
Reimar Döffinger wrote on Sun, 20 Dec 2020 18:50:30 +0100:

>  gui/util/bitmap.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

I' ve prepared a patch for this case more than 2 years ago, which looks
easier to me (avcodec_register_all() is still missing in mine, though).

The remaining question is only whether == 0 or >= 0 is a correct return
value.

--- a/gui/util/bitmap.c
+++ b/gui/util/bitmap.c
@@ -139,7 +139,8 @@
     /* HACK: Make PNGs decode normally instead of as CorePNG delta frames. */
     pkt.flags = AV_PKT_FLAG_KEY;

-    avcodec_decode_video2(avctx, frame, &decode_ok, &pkt);
+    decode_ok = (avcodec_send_packet(avctx, &pkt) == 0 &&
+                 avcodec_receive_frame(avctx, frame) == 0);

     memset(img, 0, sizeof(*img));
     memset(palette, 0, sizeof(palette));
_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.