It works, but it is not documented to work.
Showing the changes to libavcodec/avcodec.c (1 of 1 file). Show all
Unified · Split
| @@ -420,6 +420,8 @@ void avcodec_flush_buffers(AVCodecContext *avctx) · 419 unmodified lines | ||
| 420 | 420 | "that doesn't support it\n"); |
| 421 | 421 | return; |
| 422 | 422 | } |
| 423 | + if (avci->in_frame) | |
| 424 | + av_frame_unref(avci->in_frame); | |
| 423 | 425 | } |
| 424 | 426 | |
| 425 | 427 | avci->draining = 0; |
| @@ -432,7 +434,6 @@ void avcodec_flush_buffers(AVCodecContext *avctx) · 6 unmodified lines | ||
| 432 | 434 | while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0) |
| 433 | 435 | av_packet_unref(avci->last_pkt_props); |
| 434 | 436 | |
| 435 | − av_frame_unref(avci->in_frame); | |
| 436 | 437 | av_packet_unref(avci->in_pkt); |
| 437 | 438 | |
| 438 | 439 | if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) |