/*****************************************************************************
* vc1.c
*****************************************************************************
- * Copyright (C) 2001, 2002, 2006 the VideoLAN team
+ * Copyright (C) 2001, 2002, 2006 VLC authors and VideoLAN
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@videolan.org>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
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;
while( src < end && dst < dst_end )
{
if( src < end - 3 && src[0] == 0x00 && src[1] == 0x00 &&
- src[2] == 0x03 )
+ src[2] == 0x03 && dst < dst_end - 1 )
{
*dst++ = 0x00;
*dst++ = 0x00;
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 );