The idea behind last_pkt_props was to store the properties of the last packet fed to the decoder. Any sort of queueing required by CODEC_CAP_DELAY decoders that consume several packets before they start outputting frames should be done by the decoders in question. An example of this is libdav1d. This is required for the following commits that will fix last_pkt_props in frame threading scenarios, as well as maintain its contents during flush. This revers commit 022a12b306ab2096e6ac9fc9b149828a849d65b2.
Showing the changes to libavcodec/avcodec.c (1 of 4 files). Show all
Unified · Split
| @@ -386,9 +386,6 @@ void avcodec_flush_buffers(AVCodecContext *avctx) · 385 unmodified lines | ||
| 386 | 386 | av_frame_unref(avci->recon_frame); |
| 387 | 387 | } else { |
| 388 | 388 | av_packet_unref(avci->last_pkt_props); |
| 389 | − while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0) | |
| 390 | − av_packet_unref(avci->last_pkt_props); | |
| 391 | − | |
| 392 | 389 | av_packet_unref(avci->in_pkt); |
| 393 | 390 | |
| 394 | 391 | avctx->pts_correction_last_pts = |
| @@ -453,13 +450,6 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 58 unmodified lines | ||
| 453 | 450 | av_freep(&avci->byte_buffer); |
| 454 | 451 | av_frame_free(&avci->buffer_frame); |
| 455 | 452 | av_packet_free(&avci->buffer_pkt); |
| 456 | − if (avci->pkt_props) { | |
| 457 | − while (av_fifo_can_read(avci->pkt_props)) { | |
| 458 | − av_packet_unref(avci->last_pkt_props); | |
| 459 | − av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1); | |
| 460 | − } | |
| 461 | − av_fifo_freep2(&avci->pkt_props); | |
| 462 | − } | |
| 463 | 453 | av_packet_free(&avci->last_pkt_props); |
| 464 | 454 | |
| 465 | 455 | av_packet_free(&avci->in_pkt); |