[vlc-devel] [PATCH 24/24] [packetizer/dirac] Drop all encapsulation units before a seqhdr is seen.

davidf+nntp at woaf.net davidf+nntp at woaf.net
Thu Oct 30 12:29:53 CET 2008


From: David Flynn <davidf at rd.bbc.co.uk>


Signed-off-by: David Flynn <davidf at rd.bbc.co.uk>
---
 modules/packetizer/dirac.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/packetizer/dirac.c b/modules/packetizer/dirac.c
index f589c8a..f3cd7b5 100644
--- a/modules/packetizer/dirac.c
+++ b/modules/packetizer/dirac.c
@@ -73,6 +73,8 @@ struct decoder_sys_t
         uint32_t u_fps_den;
     } m_seq_hdr;
 
+    bool b_seen_seqhdr;
+
     /* Current frame being built */
     block_t    *p_frame;
     block_t    **pp_last;
@@ -170,6 +172,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
 
     if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
     {
+        p_sys->b_seen_seqhdr = false;
         /* don't think this is right XXX */
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
@@ -225,9 +228,14 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             }
             date_Increment( &p_sys->m_dts, 1);
 
+            if( !p_sys->b_seen_seqhdr ) {
+                block_Release( p_pic );
+                p_pic = NULL;
+            }
             return p_pic;
         }
         else if( 0 == p_pic->p_buffer[4] ) {
+            p_sys->b_seen_seqhdr = true;
             dirac_UnpackSeqHdr(&p_sys->m_seq_hdr, p_pic);
 
            /* a sequence header followed by an I frame is a random
-- 
1.5.6.5




More information about the vlc-devel mailing list