[vlc-commits] demux: vc1: flush packetizer (refs #3178)

Francois Cartegnie git at videolan.org
Mon Mar 6 13:16:38 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar  6 13:15:17 2017 +0100| [1395f85b5bc876ae4ffe892fe3745da29eb0e694] | committer: Francois Cartegnie

demux: vc1: flush packetizer (refs #3178)

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

 modules/demux/vc1.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/modules/demux/vc1.c b/modules/demux/vc1.c
index 78b8339..57c85c1 100644
--- a/modules/demux/vc1.c
+++ b/modules/demux/vc1.c
@@ -141,16 +141,22 @@ static int Demux( demux_t *p_demux)
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     block_t *p_block_in, *p_block_out;
+    bool b_eof = false;
 
     p_block_in = vlc_stream_Block( p_demux->s, VC1_PACKET_SIZE );
     if( p_block_in == NULL )
-        return 0;
-
-    /*  */
-    p_block_in->i_dts = VLC_TS_0;
-    p_block_in->i_pts = VLC_TS_0;
+    {
+        b_eof = true;
+    }
+    else
+    {
+        /*  */
+        p_block_in->i_dts = VLC_TS_0;
+        p_block_in->i_pts = VLC_TS_0;
+    }
 
-    while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer, &p_block_in )) )
+    while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer,
+                                                             p_block_in ? &p_block_in : NULL )) )
     {
         while( p_block_out )
         {
@@ -183,7 +189,8 @@ static int Demux( demux_t *p_demux)
                 p_sys->i_dts += CLOCK_FREQ / 25;
         }
     }
-    return 1;
+
+    return b_eof ? VLC_DEMUXER_EOF : VLC_DEMUXER_SUCCESS;
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list