You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codec.c: In function ‘CodecVideoDecode’:
codec.c:617:5: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
used = avcodec_decode_video2(video_ctx, frame, &got_frame, pkt);
^
this can fully replace it
--- codec.c.orig 2018-02-03 20:52:17.250388421 +0100
+++ codec.c 2018-02-03 20:53:22.678721937 +0100
@@ -612,8 +612,25 @@
*pkt = *avpkt; // use copy
next_part:
+#if 0
// FIXME: this function can crash with bad packets
used = avcodec_decode_video2(video_ctx, frame, &got_frame, pkt);
+#else
+ if (video_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
+ video_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
+ used = avcodec_send_packet(video_ctx, pkt);
+ if (used < 0 && used != AVERROR(EAGAIN) && used != AVERROR_EOF) {
+ } else {
+ if (used >= 0)
+ pkt->size = 0;
+ used = avcodec_receive_frame(video_ctx, frame);
+ if (used >= 0)
+ got_frame = 1;
+// if (used == AVERROR(EAGAIN) || used == AVERROR_EOF)
+// used = 0;
+ }
+ }
+#endif
Debug(4, "%s: %p %d -> %d %d\n", __FUNCTION__, pkt->data, pkt->size, used,
got_frame);
The text was updated successfully, but these errors were encountered:
codec.c: In function ‘CodecVideoDecode’:
codec.c:617:5: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
used = avcodec_decode_video2(video_ctx, frame, &got_frame, pkt);
^
this can fully replace it
The text was updated successfully, but these errors were encountered: