Commit 6ae3f4f4 authored by Gildas Bazin's avatar Gildas Bazin

* src/input/input.c: don't free the ES twice.
* modules/demux/ogg.c: ported to the es_out_*() api and fixed flac support.
* modules/codec/flac.c: couple of fixes.
parent 0b18806c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* flac.c: flac decoder/packetizer/encoder module making use of libflac * flac.c: flac decoder/packetizer/encoder module making use of libflac
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: flac.c,v 1.3 2003/11/21 20:49:13 gbazin Exp $ * $Id: flac.c,v 1.4 2003/11/22 12:41:32 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no> * Sigmund Augdal <sigmunau@idi.ntnu.no>
...@@ -186,6 +186,7 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -186,6 +186,7 @@ static int OpenDecoder( vlc_object_t *p_this )
aout_DateSet( &p_sys->end_date, 0 ); aout_DateSet( &p_sys->end_date, 0 );
p_sys->b_packetizer = VLC_FALSE; p_sys->b_packetizer = VLC_FALSE;
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
p_sys->b_stream_info = VLC_FALSE;
p_sys->bytestream = block_BytestreamInit( p_dec ); p_sys->bytestream = block_BytestreamInit( p_dec );
...@@ -217,7 +218,6 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -217,7 +218,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec->pf_decode_audio = DecodeBlock; p_dec->pf_decode_audio = DecodeBlock;
p_dec->pf_packetize = PacketizeBlock; p_dec->pf_packetize = PacketizeBlock;
/* Decode STREAMINFO */ /* Decode STREAMINFO */
msg_Dbg( p_dec, "decode STREAMINFO" ); msg_Dbg( p_dec, "decode STREAMINFO" );
p_sys->p_block = block_New( p_dec, p_dec->fmt_in.i_extra ); p_sys->p_block = block_New( p_dec, p_dec->fmt_in.i_extra );
...@@ -235,11 +235,11 @@ static int OpenPacketizer( vlc_object_t *p_this ) ...@@ -235,11 +235,11 @@ static int OpenPacketizer( vlc_object_t *p_this )
int i_ret = OpenDecoder( p_this ); int i_ret = OpenDecoder( p_this );
if( i_ret == VLC_SUCCESS ) if( i_ret != VLC_SUCCESS ) return i_ret;
{
p_dec->p_sys->b_packetizer = VLC_TRUE; p_dec->p_sys->b_packetizer = VLC_TRUE;
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
} es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
return i_ret; return i_ret;
} }
...@@ -321,6 +321,12 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -321,6 +321,12 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
break; break;
} }
if( p_sys->i_rate != p_dec->fmt_out.audio.i_rate )
{
p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
aout_DateInit( &p_sys->end_date, p_sys->i_rate );
p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
}
p_sys->i_state = STATE_NEXT_SYNC; p_sys->i_state = STATE_NEXT_SYNC;
p_sys->i_frame_size = 1; p_sys->i_frame_size = 1;
...@@ -378,7 +384,8 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -378,7 +384,8 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
/* Date management */ /* Date management */
p_sout_block->i_pts = aout_DateGet( &p_sys->end_date ); p_sout_block->i_pts =
p_sout_block->i_dts = aout_DateGet( &p_sys->end_date );
p_sout_block->i_length = p_sout_block->i_length =
aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length ); aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length );
......
This diff is collapsed.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.258 2003/11/21 00:38:01 gbazin Exp $ * $Id: input.c,v 1.259 2003/11/22 12:41:31 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -805,9 +805,6 @@ static void EndThread( input_thread_t * p_input ) ...@@ -805,9 +805,6 @@ static void EndThread( input_thread_t * p_input )
input_DumpStream( p_input ); input_DumpStream( p_input );
/* Free all ES and destroy all decoder threads */
input_EndStream( p_input );
/* Close optional stream output instance */ /* Close optional stream output instance */
if ( p_input->stream.p_sout != NULL ) if ( p_input->stream.p_sout != NULL )
{ {
...@@ -849,6 +846,9 @@ static void EndThread( input_thread_t * p_input ) ...@@ -849,6 +846,9 @@ static void EndThread( input_thread_t * p_input )
/* Free demultiplexer's data */ /* Free demultiplexer's data */
module_Unneed( p_input, p_input->p_demux ); module_Unneed( p_input, p_input->p_demux );
/* Free all ES and destroy all decoder threads */
input_EndStream( p_input );
/* Destroy the stream_t facilities */ /* Destroy the stream_t facilities */
stream_Release( p_input->s ); stream_Release( p_input->s );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment