* ogg.c : ogg stream demux module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: ogg.c,v 1.53 2004/01/25 20:05:28 hartman Exp $
+ * $Id: ogg.c,v 1.54 2004/02/06 23:43:32 gbazin Exp $
*
* Author: Gildas Bazin <gbazin@netcourrier.com>
*
block_t *p_block;
vlc_bool_t b_selected;
int i_header_len = 0;
- mtime_t i_pts;
+ mtime_t i_pts = 0;
/* Sanity check */
if( !p_oggpacket->bytes )
input_ClockManageRef( p_input,
p_input->stream.p_selected_program,
p_stream->i_pcr );
- }
-
- /* The granulepos is the end date of the sample */
- i_pts = ( p_stream->i_pcr < 0 ) ? 0 :
- input_ClockGetTS( p_input, p_input->stream.p_selected_program,
- p_stream->i_pcr );
- /* Convert the granulepos into the next pcr */
- Ogg_UpdatePCR( p_stream, p_oggpacket );
+ /* The granulepos is the end date of the sample */
+ i_pts = input_ClockGetTS( p_input,
+ p_input->stream.p_selected_program,
+ p_stream->i_pcr );
+ }
}
- else
- {
- /* Convert the granulepos into the current pcr */
- Ogg_UpdatePCR( p_stream, p_oggpacket );
- if( p_stream->i_pcr >= 0 )
- {
- /* This is for streams where the granulepos of the header packets
- * doesn't match these of the data packets (eg. ogg web radios). */
- if( p_stream->i_previous_pcr == 0 &&
- p_stream->i_pcr > 3 * DEFAULT_PTS_DELAY * 9/100 )
- p_input->stream.p_selected_program->i_synchro_state =
- SYNCHRO_REINIT;
+ /* Convert the granulepos into the next pcr */
+ Ogg_UpdatePCR( p_stream, p_oggpacket );
- p_stream->i_previous_pcr = p_stream->i_pcr;
+ if( p_stream->i_pcr >= 0 )
+ {
+ /* This is for streams where the granulepos of the header packets
+ * doesn't match these of the data packets (eg. ogg web radios). */
+ if( p_stream->i_previous_pcr == 0 &&
+ p_stream->i_pcr > 3 * DEFAULT_PTS_DELAY * 9/100 )
+ p_input->stream.p_selected_program->i_synchro_state =
+ SYNCHRO_REINIT;
+
+ /* Call the pace control */
+ if( p_input->stream.p_selected_program->i_synchro_state ==
+ SYNCHRO_REINIT )
+ input_ClockManageRef( p_input, p_input->stream.p_selected_program,
+ p_stream->i_pcr );
+ }
- /* Call the pace control */
- if( p_input->stream.p_selected_program->i_synchro_state ==
- SYNCHRO_REINIT )
- input_ClockManageRef( p_input,
- p_input->stream.p_selected_program,
- p_stream->i_pcr );
- }
+ if( !p_stream->fmt.i_codec == VLC_FOURCC( 'v','o','r','b' ) &&
+ !p_stream->fmt.i_codec == VLC_FOURCC( 's','p','x',' ' ) &&
+ !p_stream->fmt.i_codec == VLC_FOURCC( 'f','l','a','c' ) &&
+ p_stream->i_pcr >= 0 )
+ {
+ p_stream->i_previous_pcr = p_stream->i_pcr;
/* The granulepos is the start date of the sample */
- i_pts = ( p_stream->i_pcr < 0 ) ? 0 :
- input_ClockGetTS( p_input, p_input->stream.p_selected_program,
- p_stream->i_pcr );
+ i_pts = input_ClockGetTS( p_input, p_input->stream.p_selected_program,
+ p_stream->i_pcr );
}
if( !b_selected )
p_input->stream.i_mux_rate += (p_stream->fmt.i_bitrate / ( 8 * 50 ));
vlc_mutex_unlock( &p_input->stream.stream_lock );
- p_stream->i_pcr = p_stream->i_previous_pcr = -1;
+ p_stream->i_pcr = p_stream->i_previous_pcr =
+ p_stream->i_interpolated_pcr = -1;
p_stream->b_reinit = 0;
#undef p_stream
}
* avi.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: avi.c,v 1.17 2003/12/22 02:24:53 sam Exp $
+ * $Id: avi.c,v 1.18 2004/02/06 23:43:32 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
memcpy( p, fcc, 4 );
}
-static void SetDWLE( uint8_t *p, uint32_t i_dw )
-{
- p[3] = ( i_dw >> 24 )&0xff;
- p[2] = ( i_dw >> 16 )&0xff;
- p[1] = ( i_dw >> 8 )&0xff;
- p[0] = ( i_dw )&0xff;
-}
-
-
/*****************************************************************************
* Open:
*****************************************************************************/
* ogg.c: ogg muxer module for vlc
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ogg.c,v 1.27 2003/12/14 18:44:50 gbazin Exp $
+ * $Id: ogg.c,v 1.28 2004/02/06 23:43:32 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
} oggds_header_t;
-/* Helper writer functions */
-
-#define SetWLE( p, v ) _SetWLE( (uint8_t*)p, v)
-static void _SetWLE( uint8_t *p, uint16_t i_dw )
-{
- p[1] = ( i_dw >> 8 )&0xff;
- p[0] = ( i_dw )&0xff;
-}
-
-#define SetDWLE( p, v ) _SetDWLE( (uint8_t*)p, v)
-static void _SetDWLE( uint8_t *p, uint32_t i_dw )
-{
- p[3] = ( i_dw >> 24 )&0xff;
- p[2] = ( i_dw >> 16 )&0xff;
- p[1] = ( i_dw >> 8 )&0xff;
- p[0] = ( i_dw )&0xff;
-}
-#define SetQWLE( p, v ) _SetQWLE( (uint8_t*)p, v)
-static void _SetQWLE( uint8_t *p, uint64_t i_qw )
-{
- SetDWLE( p, i_qw&0xffffffff );
- SetDWLE( p+4, ( i_qw >> 32)&0xffffffff );
-}
-
/*
* TODO move this function to src/stream_output.c (used by nearly all muxers)
*/
* decoders.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
- * $Id: input.c,v 1.286 2004/02/02 12:58:29 fenrir Exp $
+ * $Id: input.c,v 1.287 2004/02/06 23:43:32 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
{
free( p_input->psz_dupsource );
}
+ input_EsOutDelete( p_input->p_es_out );
return VLC_EGENERIC;
}
{
free( p_input->psz_dupsource );
}
+ input_EsOutDelete( p_input->p_es_out );
return VLC_EGENERIC;
}
}
{
free( p_input->psz_dupsource );
}
+ input_EsOutDelete( p_input->p_es_out );
return VLC_EGENERIC;
}
{
free( p_input->psz_dupsource );
}
+ input_EsOutDelete( p_input->p_es_out );
return VLC_EGENERIC;
}