[vlc-devel] [PATCH 22/24] [packetizer/dirac] Signal random access points as BLOCK_TYPE_I

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


From: Jonathan Rosser <jrosser at rd.bbc.co.uk>

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

diff --git a/modules/packetizer/dirac.c b/modules/packetizer/dirac.c
index 67ef116..f92390b 100644
--- a/modules/packetizer/dirac.c
+++ b/modules/packetizer/dirac.c
@@ -197,7 +197,12 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         if( 0x08 & p_pic->p_buffer[4] ) {
             /* p_pic is a picture -- it ends the 'encapsulation unit' */
             uint32_t u_picnum = GetDWBE( p_pic->p_buffer + 13 );
-            //p_pic->i_flags |= BLOCK_FLAG_TYPE_I
+
+            if( 0x3 & p_pic->p_buffer[4] ) {
+                /* if this picture is not an I frame, ensure that the
+                 * random access point flags are not set */
+                p_sys->p_frame->i_flags &= ~BLOCK_FLAG_TYPE_I;
+            }
 
             p_pic = block_ChainGather( p_sys->p_frame );
             p_sys->p_frame = NULL;
@@ -225,6 +230,10 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         else if( 0 == p_pic->p_buffer[4] ) {
             dirac_UnpackSeqHdr(&p_sys->m_seq_hdr, p_pic);
 
+           /* a sequence header followed by an I frame is a random
+            * access point; assume that this is the case */
+            p_sys->p_frame->i_flags |= BLOCK_FLAG_TYPE_I;
+
             es_format_t *p_es = &p_dec->fmt_out;
 
             /* stash a copy of the seqhdr
-- 
1.5.6.5




More information about the vlc-devel mailing list