X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fvc1.c;h=9360902eb2b283d0cf526e4dafb986fa2337cfb8;hb=bc53b5d44c9283b95000e711d861f1b983a24b01;hp=968b9e8dc7c17e1345aafeb4097eba1b3f9f9859;hpb=24cddfa0efa80557f538d6dbf08f9b0b4b4d52a4;p=vlc diff --git a/modules/demux/vc1.c b/modules/demux/vc1.c index 968b9e8dc7..9360902eb2 100644 --- a/modules/demux/vc1.c +++ b/modules/demux/vc1.c @@ -1,24 +1,24 @@ /***************************************************************************** * vc1.c : VC1 Video demuxer ***************************************************************************** - * Copyright (C) 2002-2004 the VideoLAN team + * Copyright (C) 2002-2004 VLC authors and VideoLAN * $Id$ * * Authors: Laurent Aimar * - * 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. *****************************************************************************/ /***************************************************************************** @@ -32,7 +32,7 @@ #include #include #include -#include "vlc_codec.h" +#include /***************************************************************************** * Module descriptor @@ -49,7 +49,7 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_DEMUX ) set_description( N_("VC1 video demuxer" ) ) set_capability( "demux", 0 ) - add_float( "vc1-fps", 25.0, NULL, FPS_TEXT, FPS_LONGTEXT, true ) + add_float( "vc1-fps", 25.0, FPS_TEXT, FPS_LONGTEXT, true ) set_callbacks( Open, Close ) add_shortcut( "vc1" ) vlc_module_end () @@ -96,11 +96,15 @@ static int Open( vlc_object_t * p_this ) "continuing anyway" ); } + p_sys = malloc( sizeof( demux_sys_t ) ); + if( unlikely(p_sys == NULL) ) + return VLC_ENOMEM; + p_demux->pf_demux = Demux; p_demux->pf_control= Control; - p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); + p_demux->p_sys = p_sys; p_sys->p_es = NULL; - p_sys->i_dts = 1; + p_sys->i_dts = 0; p_sys->f_fps = var_CreateGetFloat( p_demux, "vc1-fps" ); if( p_sys->f_fps < 0.001 ) p_sys->f_fps = 0.0; @@ -142,8 +146,8 @@ static int Demux( demux_t *p_demux) return 0; /* */ - p_block_in->i_dts = 1; - p_block_in->i_pts = 1; + p_block_in->i_dts = VLC_TS_0; + p_block_in->i_pts = VLC_TS_0; while( (p_block_out = p_sys->p_packetizer->pf_packetize( p_sys->p_packetizer, &p_block_in )) ) { @@ -159,9 +163,9 @@ static int Demux( demux_t *p_demux) p_sys->p_es = es_out_Add( p_demux->out, &p_sys->p_packetizer->fmt_out); } - es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_dts ); - p_block_out->i_dts = p_sys->i_dts; - p_block_out->i_pts = p_sys->i_dts; + es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_dts ); + p_block_out->i_dts = VLC_TS_0 + p_sys->i_dts; + p_block_out->i_pts = VLC_TS_0 + p_sys->i_dts; es_out_Send( p_demux->out, p_sys->p_es, p_block_out );