[vlc-commits] Revert "codec: avcodec: drop frame internally"

Francois Cartegnie git at videolan.org
Mon Aug 6 11:36:52 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Aug  6 11:20:35 2018 +0200| [96056e6ca033b95a2fdc92b3274c0452d0f9ea1b] | committer: Francois Cartegnie

Revert "codec: avcodec: drop frame internally"

Supposely freeing buffers internally faster for next
frames, it worsened the aync output/frame drop algorithm
since there's no signal from avcodec of dropped frame.

This reverts commit 3f5daf4d2f5501a5e8868bf2dbfccbe615cfdf5a.

(cherry picked from commit a67ba8ca61ee5789e0b32628a79dfa58a07ee4ad)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=96056e6ca033b95a2fdc92b3274c0452d0f9ea1b
---

 modules/codec/avcodec/video.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 12d824770e..c18d4a58eb 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1034,11 +1034,6 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
             p_block->i_dts = VLC_TS_INVALID;
         }
 
-#if LIBAVCODEC_VERSION_CHECK( 57, 0, 0xFFFFFFFFU, 64, 101 )
-        if( !b_need_output_picture )
-            pkt.flags |= AV_PKT_FLAG_DISCARD;
-#endif
-
         int ret = avcodec_send_packet(p_context, &pkt);
         if( ret != 0 && ret != AVERROR(EAGAIN) )
         {
@@ -1119,7 +1114,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
 
         update_late_frame_count( p_dec, p_block, current_time, i_pts);
 
-        if( ( !p_sys->p_va && !frame->linesize[0] ) ||
+        if( !b_need_output_picture ||
+           ( !p_sys->p_va && !frame->linesize[0] ) ||
            ( p_dec->b_frame_drop_allowed && (frame->flags & AV_FRAME_FLAG_CORRUPT) &&
              !p_sys->b_show_corrupted ) )
         {
@@ -1127,14 +1123,6 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
             continue;
         }
 
-#if !LIBAVCODEC_VERSION_CHECK( 57, 0, 0xFFFFFFFFU, 64, 101 )
-        if( !b_need_output_picture )
-        {
-            av_frame_free(&frame);
-            continue;
-        }
-#endif
-
         if( p_context->pix_fmt == AV_PIX_FMT_PAL8
          && !p_dec->fmt_out.video.p_palette )
         {



More information about the vlc-commits mailing list