vlc | branch: master | Francois Cartegnie <[email protected]> | Thu Apr 13 
10:30:24 2017 +0200| [2ceb04a07e0bbab0040bb6fed18a288c86185eba] | committer: 
Francois Cartegnie

codec: avcodec: drop frame internally

output this is asynchronous.
nonsense to do this in a decoder push/pop sequence.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2ceb04a07e0bbab0040bb6fed18a288c86185eba
---

 modules/codec/avcodec/video.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index c4dba69209..59b0cace8b 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -868,6 +868,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t 
**pp_block, bool *error
             p_block->i_dts = VLC_TS_INVALID;
         }
 
+        if( !b_need_output_picture )
+            pkt.flags |= AV_PKT_FLAG_DISCARD;
+
         int ret = avcodec_send_packet(p_context, &pkt);
         if( ret != 0 && ret != AVERROR(EAGAIN) )
         {
@@ -945,7 +948,7 @@ 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( !b_need_output_picture || ( !p_sys->p_va && !frame->linesize[0] ) 
||
+        if( ( !p_sys->p_va && !frame->linesize[0] ) ||
            ( p_dec->b_frame_drop_allowed && (frame->flags & 
AV_FRAME_FLAG_CORRUPT) ) )
         {
             av_frame_free(&frame);

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to