* vc1.c
*****************************************************************************
* Copyright (C) 2001, 2002, 2006 the VideoLAN team
- * $Id: copy.c 18231 2006-12-03 17:02:02Z courmisch $
+ * $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@videolan.org>
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <vlc/vlc.h>
#include <vlc_codec.h>
*/
block_bytestream_t bytestream;
int i_state;
- int i_offset;
+ size_t i_offset;
uint8_t p_startcode[3];
/* Current sequence header */
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
p_sys->i_state = STATE_NOSYNC;
- p_sys->bytestream = block_BytestreamInit( p_dec );
+ p_sys->bytestream = block_BytestreamInit();
p_sys->p_startcode[0] = 0x00;
p_sys->p_startcode[1] = 0x00;
p_sys->p_startcode[2] = 0x01;
if( pp_block == NULL || *pp_block == NULL )
return NULL;
- if( (*pp_block)->i_flags & BLOCK_FLAG_DISCONTINUITY )
- {
- block_Release( *pp_block );
- return NULL;
- }
- if( (*pp_block)->i_flags & BLOCK_FLAG_CORRUPTED )
+ if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
- p_sys->i_state = STATE_NOSYNC;
- if( p_sys->p_frame )
- block_ChainRelease( p_sys->p_frame );
- p_sys->p_frame = NULL;
- p_sys->pp_last = &p_sys->p_frame;
+ if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
+ {
+ p_sys->i_state = STATE_NOSYNC;
+ block_BytestreamFlush( &p_sys->bytestream );
+
+ if( p_sys->p_frame )
+ block_ChainRelease( p_sys->p_frame );
+ p_sys->p_frame = NULL;
+ p_sys->pp_last = &p_sys->p_frame;
+ p_sys->b_frame = VLC_FALSE;
+ }
+// p_sys->i_interpolated_dts = 0;
block_Release( *pp_block );
return NULL;
}
if( i_ridu > 4 && (ridu[0]&0x80) == 0 ) /* for advanced profile, the first bit is 1 */
{
video_format_t *p_v = &p_dec->fmt_in.video;
- const int i_potential_width = GetWBE( &ridu[0] );
- const int i_potential_height = GetWBE( &ridu[2] );
+ const size_t i_potential_width = GetWBE( &ridu[0] );
+ const size_t i_potential_height = GetWBE( &ridu[2] );
if( i_potential_width >= 2 && i_potential_width <= 8192 &&
i_potential_height >= 2 && i_potential_height <= 8192 )
{64,33}, {160,99},{ 0, 0}, { 0, 0}
};
int i_ar = bs_read( &s, 4 );
- int i_ar_w, i_ar_h;
+ unsigned i_ar_w, i_ar_h;
if( i_ar == 15 )
{