X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fpva.c;h=8ab85f14c7485a8be58fec6a7e832c658e1d21ae;hb=27d483e9ef7a451397d7857251c8d67097661f1d;hp=711d117504252a8626f59bc920bb505840b8dec1;hpb=83fb2ffc0f3884d99ea91d0de0451a6923fb944a;p=vlc diff --git a/modules/demux/pva.c b/modules/demux/pva.c index 711d117504..8ab85f14c7 100644 --- a/modules/demux/pva.c +++ b/modules/demux/pva.c @@ -1,8 +1,8 @@ /***************************************************************************** * pva.c: PVA demuxer ***************************************************************************** - * Copyright (C) 2004 VideoLAN - * $Id: pva.c,v 1.1 2004/01/23 17:42:10 fenrir Exp $ + * Copyright (C) 2004 the VideoLAN team + * $Id$ * * Authors: Laurent Aimar * @@ -18,20 +18,20 @@ * * 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ -#include /* malloc(), free() */ -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif -/* TODO: - * - ... - */ +#include +#include +#include /***************************************************************************** * Module descriptor @@ -41,7 +41,9 @@ static void Close ( vlc_object_t * ); vlc_module_begin(); set_description( _("PVA demuxer" ) ); - set_capability( "demux2", 10 ); + set_capability( "demux", 10 ); + set_category( CAT_INPUT ); + set_subcategory( SUBCAT_INPUT_DEMUX ); set_callbacks( Open, Close ); add_shortcut( "pva" ); vlc_module_end(); @@ -80,21 +82,14 @@ static int Open( vlc_object_t *p_this ) demux_t *p_demux = (demux_t*)p_this; demux_sys_t *p_sys; es_format_t fmt; - uint8_t *p_peek; + const uint8_t *p_peek; - if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) - { - msg_Err( p_demux, "cannot peek" ); - return VLC_EGENERIC; - } + if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC; if( p_peek[0] != 'A' || p_peek[1] != 'V' || p_peek[4] != 0x55 ) { /* In case we had forced this demuxer we try to resynch */ - if( strcasecmp( p_demux->psz_demux, "pva" ) || ReSynch( p_demux ) ) - { - msg_Warn( p_demux, "PVA module discarded" ); + if( !p_demux->b_force || ReSynch( p_demux ) ) return VLC_EGENERIC; - } } /* Fill p_demux field */ @@ -114,7 +109,7 @@ static int Open( vlc_object_t *p_this ) p_sys->p_pes = NULL; p_sys->p_es = NULL; - p_sys->b_pcr_audio = VLC_FALSE; + p_sys->b_pcr_audio = false; return VLC_SUCCESS; } @@ -141,7 +136,7 @@ static int Demux( demux_t *p_demux ) { demux_sys_t *p_sys = p_demux->p_sys; - uint8_t *p_peek; + const uint8_t *p_peek; int i_size; block_t *p_frame; int64_t i_pts; @@ -328,13 +323,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) *pi64 = 0; return VLC_EGENERIC; - case DEMUX_SET_TIME: #endif case DEMUX_GET_FPS: pf = (double*)va_arg( args, double * ); *pf = (double)1000000.0 / (double)p_sys->i_pcr_inc; return VLC_SUCCESS; #endif + case DEMUX_SET_TIME: default: return VLC_EGENERIC; } @@ -345,7 +340,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) *****************************************************************************/ static int ReSynch( demux_t *p_demux ) { - uint8_t *p_peek; + const uint8_t *p_peek; int i_skip; int i_peek; @@ -439,7 +434,7 @@ static void ParsePES( demux_t *p_demux ) if( p_pes->i_pts > 0 ) { es_out_Control( p_demux->out, ES_OUT_SET_PCR, (int64_t)p_pes->i_pts); - p_sys->b_pcr_audio = VLC_TRUE; + p_sys->b_pcr_audio = true; } es_out_Send( p_demux->out, p_sys->p_audio, p_pes ); }