/*****************************************************************************
* mpegvideo.c: parse and packetize an MPEG1/2 video stream
*****************************************************************************
- * Copyright (C) 2001-2006 the VideoLAN team
+ * Copyright (C) 2001-2006 VLC authors and VideoLAN
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@videolan.org>
* Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
*
- * 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.
*****************************************************************************/
/*****************************************************************************
set_capability( "packetizer", 50 )
set_callbacks( Open, Close )
- add_bool( "packetizer-mpegvideo-sync-iframe", false, NULL, SYNC_INTRAFRAME_TEXT,
+ add_bool( "packetizer-mpegvideo-sync-iframe", false, SYNC_INTRAFRAME_TEXT,
SYNC_INTRAFRAME_LONGTEXT, true )
vlc_module_end ()
/* Misc init */
packetizer_Init( &p_sys->packetizer,
p_mp2v_startcode, sizeof(p_mp2v_startcode),
- NULL, 0,
+ NULL, 0, 4,
PacketizeReset, PacketizeParse, PacketizeValidate, p_dec );
p_sys->p_seq = NULL;
if( p_sys->cc.i_data <= 0 )
return NULL;
- p_cc = block_New( p_dec, p_sys->cc.i_data);
+ p_cc = block_Alloc( p_sys->cc.i_data );
if( p_cc )
{
memcpy( p_cc->p_buffer, p_sys->cc.p_data, p_sys->cc.i_data );
decoder_t *p_dec = p_private;
/* Check if we have a picture start code */
- *pb_ts_used = p_block->i_buffer >= 4 && p_block->p_buffer[3] == 0x00;
+ *pb_ts_used = p_block->p_buffer[3] == 0x00;
return ParseMPEGBlock( p_dec, p_block );
}
if( p_sys->p_seq &&
p_sys->i_seq_old > p_sys->i_frame_rate/p_sys->i_frame_rate_base )
{
- /* Usefull for mpeg1: repeat sequence header every second */
+ /* Useful for mpeg1: repeat sequence header every second */
block_ChainLastAppend( &p_sys->pp_last, block_Duplicate( p_sys->p_seq ) );
if( p_sys->p_ext )
{
/* Unofficial 15fps from Xing*/
{ 15, 1001 },
/* Unofficial economy rates from libmpeg3 */
- { 5, 1001 }, { 10, 1001 }, { 12, 1001 }, { 15, 1001 },
+ { 5000, 1001 }, { 1000, 1001 }, { 12000, 1001 }, { 15000, 1001 },
{ 1, 1 }, { 1, 1 } /* invalid */
};
* of aspect ratio change, we're screwed. --Meuuh
*/
#if 0
- p_dec->fmt_out.video.i_aspect =
+ p_dec->fmt_out.video.i_sar_num =
mpeg2_aspect[p_sys->i_aspect_ratio_info][0] *
- VOUT_ASPECT_FACTOR /
- mpeg2_aspect[p_sys->i_aspect_ratio_info][1];
+ p_dec->fmt_out.video.i_height;
+ p_dec->fmt_out.video.i_sar_den =
+ mpeg2_aspect[p_sys->i_aspect_ratio_info][1] *
+ p_dec->fmt_out.video.i_width;
#endif
}
}
else if( p_frag->p_buffer[3] == 0xb2 && p_frag->i_buffer > 4 )
{
- cc_Extract( &p_sys->cc, &p_frag->p_buffer[4], p_frag->i_buffer - 4 );
+ cc_Extract( &p_sys->cc, p_sys->i_top_field_first,
+ &p_frag->p_buffer[4], p_frag->i_buffer - 4 );
}
else if( p_frag->p_buffer[3] == 0x00 )
{