#include <vlc_codec.h>
#include <vlc_block.h>
-#include "vlc_bits.h"
-#include "vlc_block_helper.h"
+#include <vlc_bits.h>
+#include <vlc_block_helper.h>
#include "packetizer_helper.h"
/*****************************************************************************
/* Create the output format */
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
+ if( unlikely( !p_sys ) )
+ return VLC_ENOMEM;
packetizer_Init( &p_sys->packetizer,
p_vc1_startcode, sizeof(p_vc1_startcode),
- NULL, 0,
+ NULL, 0, 4,
PacketizeReset, PacketizeParse, PacketizeValidate, p_dec );
p_sys->b_sequence_header = false;
if( p_sys->b_check_startcode && pp_block && *pp_block )
{
/* Fix syntax for (some?) VC1 from asf */
- const int i_startcode = sizeof(p_vc1_startcode);
+ const unsigned i_startcode = sizeof(p_vc1_startcode);
block_t *p_block = *pp_block;
if( p_block->i_buffer > 0 &&
if( p_es->i_extra != i_extra )
{
p_es->i_extra = i_extra;
- p_es->p_extra = realloc( p_dec->fmt_out.p_extra, p_es->i_extra );
+ p_es->p_extra = xrealloc( p_es->p_extra, p_es->i_extra );
}
memcpy( p_es->p_extra,
p_sys->sh.p_sh->p_buffer, p_sys->sh.p_sh->i_buffer );
const int i_display_width = bs_read( &s, 14 )+1;
const int i_display_height = bs_read( &s, 14 )+1;
- p_es->video.i_aspect = VOUT_ASPECT_FACTOR * i_display_width / i_display_height;
+ p_es->video.i_sar_num = i_display_width * p_es->video.i_height;
+ p_es->video.i_sar_den = i_display_height * p_es->video.i_width;
if( !p_sys->b_sequence_header )
msg_Dbg( p_dec, "display size %dx%d", i_display_width, i_display_height );