[vlc-commits] packetizer: vc1: perform secondary drain

Francois Cartegnie git at videolan.org
Sat Oct 19 14:03:11 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Oct 14 11:20:36 2019 +0200| [2ca3bb8be6c7a7ec0f974db2344c60cc1837f8a1] | committer: Francois Cartegnie

packetizer: vc1: perform secondary drain

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

 modules/packetizer/vc1.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c
index f41d244432..7317d440e2 100644
--- a/modules/packetizer/vc1.c
+++ b/modules/packetizer/vc1.c
@@ -128,7 +128,9 @@ static void Flush( decoder_t * );
 static void PacketizeReset( void *p_private, bool b_broken );
 static block_t *PacketizeParse( void *p_private, bool *pb_ts_used, block_t * );
 static int PacketizeValidate( void *p_private, block_t * );
+static block_t *PacketizeDrain( void *p_private );
 
+static block_t *OutputFrame( decoder_t *p_dec );
 static block_t *ParseIDU( decoder_t *p_dec, bool *pb_ts_used, block_t *p_frag );
 static block_t *GetCc( decoder_t *p_dec, decoder_cc_desc_t * );
 
@@ -160,7 +162,7 @@ static int Open( vlc_object_t *p_this )
     packetizer_Init( &p_sys->packetizer,
                      p_vc1_startcode, sizeof(p_vc1_startcode), startcode_FindAnnexB,
                      NULL, 0, 4,
-                     PacketizeReset, PacketizeParse, PacketizeValidate, NULL,
+                     PacketizeReset, PacketizeParse, PacketizeValidate, PacketizeDrain,
                      p_dec );
 
     p_sys->b_sequence_header = false;
@@ -317,6 +319,13 @@ static int PacketizeValidate( void *p_private, block_t *p_au )
     return VLC_SUCCESS;
 }
 
+static block_t * PacketizeDrain( void *p_private )
+{
+    decoder_t *p_dec = p_private;
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    return p_sys->b_frame ? OutputFrame( p_dec ) : NULL;
+}
+
 /* BuildExtraData: gather sequence header and entry point */
 static void BuildExtraData( decoder_t *p_dec )
 {



More information about the vlc-commits mailing list