diff options
69 files changed, 285 insertions, 189 deletions
@@ -7,6 +7,7 @@ xine-lib (1-rc4) * dxr3: fix situation, where the initial menu on some DVDs would have the wrong aspect * major refinement of post plugin architecture fixes a lot of races + * fix runtime audio channel selection, specially for ogg/ogm streams xine-lib (1-rc3a) * new subtitle formats: jacobsub, subviewer 2.0, subrip 0.9 diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c index c936d1065..fe96e944a 100644 --- a/src/demuxers/demux_4xm.c +++ b/src/demuxers/demux_4xm.c @@ -23,7 +23,7 @@ * For more information on the 4xm file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_4xm.c,v 1.12 2003/11/26 19:43:27 f1rmb Exp $ + * $Id: demux_4xm.c,v 1.13 2004/01/09 01:26:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -402,7 +402,7 @@ static void demux_fourxm_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->video_pts_inc; /* initial video_step */ memcpy(buf->content, &this->bih, sizeof(this->bih)); @@ -413,7 +413,7 @@ static void demux_fourxm_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->track_count > 0) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->tracks[0].audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->tracks[0].sample_rate; buf->decoder_info[2] = this->tracks[0].bits; diff --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c index 8008a0d27..6340b918d 100644 --- a/src/demuxers/demux_aac.c +++ b/src/demuxers/demux_aac.c @@ -21,7 +21,7 @@ * This demuxer presently only detects a raw AAC file by the extension * '.aac'. Then it shovels buffer-sized chunks over to the AAC decoder. * - * $Id: demux_aac.c,v 1.1 2003/12/19 05:09:16 tmmm Exp $ + * $Id: demux_aac.c,v 1.2 2004/01/09 01:26:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -107,7 +107,7 @@ static void demux_aac_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_AAC; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; /* this is a guess at the correct parameters */ buf->decoder_info[1] = 44100; diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c index 992620d17..1ec686674 100644 --- a/src/demuxers/demux_ac3.c +++ b/src/demuxers/demux_ac3.c @@ -23,7 +23,7 @@ * This demuxer detects raw AC3 data in a file and shovels AC3 data * directly to the AC3 decoder. * - * $Id: demux_ac3.c,v 1.14 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_ac3.c,v 1.15 2004/01/09 01:26:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -240,7 +240,7 @@ static void demux_ac3_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_A52; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END; buf->size = 0; this->audio_fifo->put (this->audio_fifo, buf); } diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 73af2fff6..4d8020aa8 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -21,7 +21,7 @@ /* * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_aiff.c,v 1.37 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_aiff.c,v 1.38 2004/01/09 01:26:32 miguelfreitas Exp $ * */ @@ -253,7 +253,7 @@ static void demux_aiff_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->audio_sample_rate; buf->decoder_info[2] = this->audio_bits; diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 2596ab40f..2ae184823 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.145 2003/12/05 15:54:57 f1rmb Exp $ + * $Id: demux_asf.c,v 1.146 2004/01/09 01:26:32 miguelfreitas Exp $ * * demultiplexer for asf streams * @@ -307,7 +307,7 @@ static void asf_send_audio_header (demux_asf_t *this, int stream) { buf->size = this->wavex_size; buf->type = this->streams[stream].buf_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[1] = wavex->nSamplesPerSec; buf->decoder_info[2] = wavex->wBitsPerSample; buf->decoder_info[3] = wavex->nChannels; @@ -329,7 +329,7 @@ static void asf_send_video_header (demux_asf_t *this, int stream) { _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_FOURCC, bih->biCompression); buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[1] = 3000; /* FIXME ! */ memcpy (buf->content, &this->bih, this->bih_size); buf->size = this->bih_size; diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c index 4b3691bf6..d4351b1be 100644 --- a/src/demuxers/demux_aud.c +++ b/src/demuxers/demux_aud.c @@ -34,7 +34,7 @@ * data. This makes seeking conceptually impossible. Upshot: Random * seeking is not supported. * - * $Id: demux_aud.c,v 1.15 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_aud.c,v 1.16 2004/01/09 01:26:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -211,7 +211,7 @@ static void demux_aud_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->audio_samplerate; buf->decoder_info[2] = this->audio_bits; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 873a49900..72f18ac02 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_avi.c,v 1.185 2003/12/23 16:58:25 mroi Exp $ + * $Id: demux_avi.c,v 1.186 2004/01/09 01:26:32 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -1532,7 +1532,7 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) { _x_demux_control_start (this->stream); buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[1] = this->video_step; memcpy (buf->content, this->avi->bih, this->avi->bih->biSize); buf->size = this->avi->bih->biSize; @@ -1562,7 +1562,7 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) { /* send off the palette, if there is one */ if (this->avi->palette_count) { buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_PALETTE; buf->decoder_info[2] = this->avi->palette_count; buf->decoder_info_ptr[2] = &this->avi->palette; @@ -1578,7 +1578,7 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); wavex_len = (a->wavex_len < buf->max_size) ? a->wavex_len : buf->max_size; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; memcpy (buf->content, a->wavex, wavex_len); buf->size = wavex_len; buf->type = a->audio_type | i; diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c index c771d93c6..2c12c4902 100644 --- a/src/demuxers/demux_cdda.c +++ b/src/demuxers/demux_cdda.c @@ -24,7 +24,7 @@ * linear PCM "decoder" (which in turn sends them directly to the audio * output target; this is a really fancy CD-playing architecture). * - * $Id: demux_cdda.c,v 1.17 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_cdda.c,v 1.18 2004/01/09 01:26:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -127,7 +127,7 @@ static void demux_cdda_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_LPCM_LE; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = 44100; buf->decoder_info[2] = 16; diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c index 2ee247459..1e67154c8 100644 --- a/src/demuxers/demux_eawve.c +++ b/src/demuxers/demux_eawve.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_eawve.c,v 1.26 2003/11/26 19:43:29 f1rmb Exp $ + * $Id: demux_eawve.c,v 1.27 2004/01/09 01:26:32 miguelfreitas Exp $ * * demux_eawve.c, Demuxer plugin for Electronic Arts' WVE file format * @@ -299,7 +299,7 @@ static void demux_eawve_send_headers(demux_plugin_t *this_gen){ buf = this->audio_fifo->buffer_pool_alloc(this->audio_fifo); buf->type = BUF_AUDIO_EA_ADPCM; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = 22050; buf->decoder_info[2] = 16; diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 0e65514b0..2f548b459 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.73 2003/12/05 15:54:57 f1rmb Exp $ + * $Id: demux_film.c,v 1.74 2004/01/09 01:26:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -692,7 +692,7 @@ static void demux_film_send_headers(demux_plugin_t *this_gen) { } buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = initial_duration; memcpy(buf->content, &this->bih, sizeof(this->bih)); @@ -704,7 +704,7 @@ static void demux_film_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_LPCM_BE; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->sample_rate; buf->decoder_info[2] = this->audio_bits; diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index cec36f2ff..3f0738a08 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -24,7 +24,7 @@ * avoid while programming a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_fli.c,v 1.48 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_fli.c,v 1.49 2004/01/09 01:26:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -239,7 +239,7 @@ static void demux_fli_send_headers(demux_plugin_t *this_gen) { /* send init info to FLI decoder */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->frame_pts_inc; /* initial video_step */ /* be a rebel and send the FLI header instead of the bih */ diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c index 00e4b943b..09c7e47f2 100644 --- a/src/demuxers/demux_idcin.c +++ b/src/demuxers/demux_idcin.c @@ -65,7 +65,7 @@ * - if any bytes exceed 63, do not shift the bytes at all before * transmitting them to the video decoder * - * $Id: demux_idcin.c,v 1.49 2003/11/26 19:43:30 f1rmb Exp $ + * $Id: demux_idcin.c,v 1.50 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -175,7 +175,7 @@ static int demux_idcin_send_chunk(demux_plugin_t *this_gen) { } buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_PALETTE; buf->decoder_info[2] = PALETTE_SIZE; buf->decoder_info_ptr[2] = &palette; @@ -369,7 +369,7 @@ static void demux_idcin_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ bih->biSize = sizeof(xine_bmiheader) + HUFFMAN_TABLE_SIZE; buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = IDCIN_FRAME_PTS_INC; /* initial video_step */ buf->size = bih->biSize; @@ -395,7 +395,7 @@ static void demux_idcin_send_headers(demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_LPCM_LE; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->wave.nSamplesPerSec; buf->decoder_info[2] = this->wave.wBitsPerSample; diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c index 1526330ea..44bab6b39 100644 --- a/src/demuxers/demux_iff.c +++ b/src/demuxers/demux_iff.c @@ -32,7 +32,7 @@ * (no examples found and description isn't as clear as it should) * * 16SV, the same support as 8SVX * - * $Id: demux_iff.c,v 1.2 2004/01/04 00:41:33 manfredtremmel Exp $ + * $Id: demux_iff.c,v 1.3 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -743,7 +743,7 @@ static void demux_iff_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->vhdr_samplesPerSec; buf->decoder_info[2] = this->audio_bits; diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c index 97e435dd7..37e75736b 100644 --- a/src/demuxers/demux_ipmovie.c +++ b/src/demuxers/demux_ipmovie.c @@ -23,7 +23,7 @@ * For more information regarding the Interplay MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_ipmovie.c,v 1.20 2003/11/26 19:43:30 f1rmb Exp $ + * $Id: demux_ipmovie.c,v 1.21 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -435,7 +435,7 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) { /* send off any new palette data */ if (this->new_palette) { buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_PALETTE; buf->decoder_info[2] = 256; buf->decoder_info_ptr[2] = &this->palette; @@ -580,7 +580,7 @@ static void demux_ipmovie_send_headers(demux_plugin_t *this_gen) { /* send init info to video decoder */ this->bih.biSize = sizeof(xine_bmiheader); buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; /* bogus initial video_step, but we won't know for sure until we see * the first video frame; however, fps for these files is usually 15 */ @@ -592,7 +592,7 @@ static void demux_ipmovie_send_headers(demux_plugin_t *this_gen) { /* send off the palette */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_PALETTE; buf->decoder_info[2] = 256; buf->decoder_info_ptr[2] = &this->palette; @@ -609,7 +609,7 @@ static void demux_ipmovie_send_headers(demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->wave.nSamplesPerSec; buf->decoder_info[2] = this->wave.wBitsPerSample; diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 363826af1..fa77345f0 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_matroska.c,v 1.4 2004/01/05 19:39:10 tmattern Exp $ + * $Id: demux_matroska.c,v 1.5 2004/01/09 01:26:33 miguelfreitas Exp $ * * demultiplexer for matroska streams * @@ -296,7 +296,7 @@ static void init_codec_video(demux_matroska_t *this, matroska_track_t *track) { else buf->content = NULL; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END; buf->type = track->buf_type; buf->pts = 0; track->fifo->put (track->fifo, buf); @@ -336,7 +336,7 @@ static void init_codec_audio(demux_matroska_t *this, matroska_track_t *track) { else buf->content = NULL; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END; buf->type = track->buf_type; buf->pts = 0; track->fifo->put (track->fifo, buf); diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c index e1afda477..b36135374 100644 --- a/src/demuxers/demux_mng.c +++ b/src/demuxers/demux_mng.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_mng.c,v 1.18 2003/12/10 00:54:25 hadess Exp $ + * $Id: demux_mng.c,v 1.19 2004/01/09 01:26:33 miguelfreitas Exp $ * * demux_mng.c, Demuxer plugin for Multiple-image Network Graphics format * @@ -220,7 +220,7 @@ static void demux_mng_send_headers(demux_mng_t *this){ buf->type = BUF_VIDEO_RGB; buf->size = sizeof(xine_bmiheader); memcpy(buf->content, &this->bih, sizeof(xine_bmiheader)); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; this->video_fifo->put(this->video_fifo, buf); } diff --git a/src/demuxers/demux_nsf.c b/src/demuxers/demux_nsf.c index eb89c1b01..b76cd2cec 100644 --- a/src/demuxers/demux_nsf.c +++ b/src/demuxers/demux_nsf.c @@ -30,7 +30,7 @@ * For more information regarding the NSF format, visit: * http://www.tripoint.org/kevtris/nes/nsfspec.txt * - * $Id: demux_nsf.c,v 1.20 2003/11/26 23:44:09 f1rmb Exp $ + * $Id: demux_nsf.c,v 1.21 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -216,7 +216,7 @@ static void demux_nsf_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_NSF; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 5; buf->decoder_info[1] = NSF_SAMPLERATE; buf->decoder_info[2] = NSF_BITS; diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c index 88875be98..03226ee42 100644 --- a/src/demuxers/demux_nsv.c +++ b/src/demuxers/demux_nsv.c @@ -23,7 +23,7 @@ * For more information regarding the NSV file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_nsv.c,v 1.12 2004/01/04 11:59:33 hadess Exp $ + * $Id: demux_nsv.c,v 1.13 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -378,7 +378,7 @@ static void demux_nsv_send_headers(demux_plugin_t *this_gen) { /* send init info to the video decoder */ if (this->video_fifo && this->video_type) { buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->frame_pts_inc; memcpy(buf->content, &this->bih, sizeof(this->bih)); diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index 72e8c6c02..f722280da 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_ogg.c,v 1.130 2003/12/30 17:21:02 miguelfreitas Exp $ + * $Id: demux_ogg.c,v 1.131 2004/01/09 01:26:33 miguelfreitas Exp $ * * demultiplexer for ogg streams * @@ -113,7 +113,7 @@ typedef struct demux_ogg_s { ogg_stream_state oss[MAX_STREAMS]; uint32_t buf_types[MAX_STREAMS]; - int preview_buffers[MAX_STREAMS]; + int headers[MAX_STREAMS]; int64_t header_granulepos[MAX_STREAMS]; int64_t factor[MAX_STREAMS]; int64_t quotient[MAX_STREAMS]; @@ -727,7 +727,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { this->buf_types[stream_num] = BUF_AUDIO_VORBIS +this->num_audio_streams++; - this->preview_buffers[stream_num] = 3; + this->headers[stream_num] = 3; vorbis_info_init(&vi); vorbis_comment_init(&vc); @@ -750,7 +750,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { this->factor[stream_num] = 900; this->quotient[stream_num] = 441; - this->preview_buffers[stream_num] = 0; + this->headers[stream_num] = 0; xine_log (this->stream->xine, XINE_LOG_MSG, _("ogg: vorbis audio track indicated but no vorbis stream header found.\n")); } @@ -766,7 +766,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { this->buf_types[stream_num] = BUF_AUDIO_SPEEX +this->num_audio_streams++; - this->preview_buffers[stream_num] = 1; + this->headers[stream_num] = 1; header = speex_packet_to_header (op.packet, op.bytes); @@ -795,7 +795,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, header->rate); - this->preview_buffers[stream_num] += header->extra_headers; + this->headers[stream_num] += header->extra_headers; } #else xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Speex stream detected, unable to play\n"); @@ -837,7 +837,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { if( !this->buf_types[stream_num] ) this->buf_types[stream_num] = BUF_VIDEO_UNKNOWN; this->buf_types[stream_num] |= channel; - this->preview_buffers[stream_num] = 5; /* FIXME: don't know */ + this->headers[stream_num] = 0; /* header is sent below */ lprintf ("subtype %.4s\n", (char*)&locsubtype); lprintf ("time_unit %lld\n", loctime_unit); @@ -862,7 +862,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { bih.biClrImportant=0; buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; this->frame_duration = loctime_unit * 9 / 1000; this->factor[stream_num] = loctime_unit * 9; this->quotient[stream_num] = 1000; @@ -944,14 +944,14 @@ static void demux_ogg_send_header (demux_ogg_t *this) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->buf_types[stream_num]; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = locsamples_per_unit; buf->decoder_info[2] = locbits_per_sample; buf->decoder_info[3] = locchannels; this->audio_fifo->put (this->audio_fifo, buf); - this->preview_buffers[stream_num] = 5; /* FIXME: don't know */ + this->headers[stream_num] = 0; /* header already sent */ this->factor[stream_num] = 90000; this->quotient[stream_num] = locsamples_per_unit; @@ -984,7 +984,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { #ifdef LOG xine_hexdump (op.packet, op.bytes); #endif - this->preview_buffers[stream_num] = 5; /* FIXME: don't know */ + this->headers[stream_num] = 0; /* header is sent below */ if ( (LE_32(&op.packet[96])==0x05589f80) && (op.bytes>=184)) { @@ -1019,7 +1019,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { bih.biClrImportant = 0; buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; this->frame_duration = (*(int64_t*)(op.packet+164)) * 9 / 1000; this->factor[stream_num] = (*(int64_t*)(op.packet+164)) * 9; this->quotient[stream_num] = 1000; @@ -1090,7 +1090,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { buf_element_t *buf; lprintf ("textstream detected.\n"); - this->preview_buffers[stream_num] = 2; + this->headers[stream_num] = 0; channel= this->num_spu_streams++; this->buf_types[stream_num] = BUF_SPU_OGM | channel; @@ -1119,7 +1119,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { this->frame_duration = ((int64_t) 90000*this->t_info.fps_denominator)/this->t_info.fps_numerator; - this->preview_buffers[stream_num]=3; + this->headers[stream_num]=3; this->buf_types[stream_num] = BUF_VIDEO_THEORA; _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, "theora"); @@ -1146,7 +1146,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "A theora header was rejected by libtheora\n"); this->buf_types[stream_num] = BUF_CONTROL_NOP; - this->preview_buffers[stream_num] = 5; /* FIXME: don't know */ + this->headers[stream_num] = 0; /* FIXME: don't know */ } #else this->buf_types[stream_num] = BUF_VIDEO_THEORA; @@ -1171,23 +1171,23 @@ static void demux_ogg_send_header (demux_ogg_t *this) { lprintf ("sending preview buffer of stream type %08x\n", this->buf_types[stream_num]); - send_ogg_buf (this, &op, stream_num, BUF_FLAG_PREVIEW); + send_ogg_buf (this, &op, stream_num, BUF_FLAG_HEADER); if (!ogg_page_bos(&this->og)) { int i; /* are we finished ? */ - this->preview_buffers[stream_num] --; + this->headers[stream_num] --; done = 1; for (i=0; i<this->num_streams; i++) { - if (this->preview_buffers[i]>0) + if (this->headers[i]>0) done = 0; lprintf ("%d preview buffers left to send from stream %d\n", - this->preview_buffers[i], i); + this->headers[i], i); } } } @@ -1574,6 +1574,7 @@ static int demux_ogg_get_optional_data(demux_plugin_t *this_gen, switch (data_type) { case DEMUX_OPTIONAL_DATA_SPULANG: + lprintf ("DEMUX_OPTIONAL_DATA_SPULANG channel = %d\n",channel); if (channel==-1) { strcpy( str, "none"); return DEMUX_OPTIONAL_SUCCESS; @@ -1598,6 +1599,7 @@ static int demux_ogg_get_optional_data(demux_plugin_t *this_gen, } return DEMUX_OPTIONAL_UNSUPPORTED; case DEMUX_OPTIONAL_DATA_AUDIOLANG: + lprintf ("DEMUX_OPTIONAL_DATA_AUDIOLANG channel = %d\n",channel); if (channel==-1) { strcpy( str, "none"); return DEMUX_OPTIONAL_SUCCESS; diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 3b3952c74..aa6f5765c 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -30,7 +30,7 @@ * build_frame_table * free_qt_info * - * $Id: demux_qt.c,v 1.174 2004/01/06 05:39:07 tmmm Exp $ + * $Id: demux_qt.c,v 1.175 2004/01/09 01:26:33 miguelfreitas Exp $ * */ @@ -2424,7 +2424,7 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { if (video_trak && (video_trak->properties->video.codec_buftype)) { buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; /* initial video step; not necessary since each QT frame has its own * duration, but set it non-zero as a matter of custom */ @@ -2446,7 +2446,7 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { /* send off the palette, if there is one */ if (video_trak->properties->video.palette_count) { buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_PALETTE; buf->decoder_info[2] = video_trak->properties->video.palette_count; buf->decoder_info_ptr[2] = &video_trak->properties->video.palette; @@ -2457,7 +2457,7 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { /* send stsd to the decoder */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_STSD_ATOM; buf->decoder_info[2] = video_trak->properties->video.properties_atom_size; buf->decoder_info_ptr[2] = video_trak->properties->video.properties_atom; @@ -2472,7 +2472,7 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = audio_trak->properties->audio.codec_buftype; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = audio_trak->properties->audio.sample_rate; buf->decoder_info[2] = audio_trak->properties->audio.bits; @@ -2485,7 +2485,7 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = audio_trak->properties->audio.codec_buftype; buf->size = 0; - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG; buf->decoder_info[2] = audio_trak->decoder_config_len; buf->decoder_info_ptr[2] = audio_trak->decoder_config; @@ -2494,7 +2494,7 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { /* send stsd to the decoder */ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_STSD_ATOM; buf->decoder_info[2] = audio_trak->properties->audio.properties_atom_size; buf->decoder_info_ptr[2] = audio_trak->properties->audio.properties_atom; diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c index cee1b5c36..47a4c4c30 100644 --- a/src/demuxers/demux_rawdv.c +++ b/src/demuxers/demux_rawdv.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_rawdv.c,v 1.16 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_rawdv.c,v 1.17 2004/01/09 01:26:33 miguelfreitas Exp $ * * demultiplexer for raw dv streams */ @@ -178,7 +178,7 @@ static void demux_raw_dv_send_headers (demux_plugin_t *this_gen) { buf = this->video_fifo->buffer_pool_alloc(this->video_fifo); buf->content = buf->mem; buf->type = BUF_VIDEO_DV; - buf->decoder_flags |= BUF_FLAG_HEADER; + buf->decoder_flags |= BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; bih = (xine_bmiheader *)buf->content; diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 7d75c26d8..ff43824e1 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -31,7 +31,7 @@ * * Based on FFmpeg's libav/rm.c. * - * $Id: demux_real.c,v 1.75 2004/01/08 23:17:34 jstembridge Exp $ + * $Id: demux_real.c,v 1.76 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -672,15 +672,16 @@ unknown: lprintf("setting size to w:%u h:%u for RV10\n", bih.biWidth, bih.biHeight); lprintf("setting sub-codec to %X for RV10\n", bih.biCompression); memcpy(buf->content, &bih, bih.biSize); + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; } else { memcpy(buf->content, this->video_stream->mdpr->type_specific_data, this->video_stream->mdpr->type_specific_len); buf->size = this->video_stream->mdpr->type_specific_len; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END; } buf->type = this->video_stream->buf_type; - buf->decoder_flags = BUF_FLAG_HEADER; buf->extra_info->input_pos = 0; buf->extra_info->input_time = 0; @@ -713,7 +714,7 @@ unknown: buf->size = this->audio_stream->mdpr->type_specific_len - 4; buf->type = this->audio_stream->buf_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END; buf->extra_info->input_pos = 0; buf->extra_info->input_time = 0; diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index 70ddddb53..d1bab47f2 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -22,7 +22,7 @@ * RealAudio File Demuxer by Mike Melanson (melanson@pcisys.net) * improved by James Stembridge (jstembridge@users.sourceforge.net) * - * $Id: demux_realaudio.c,v 1.28 2003/12/05 15:54:57 f1rmb Exp $ + * $Id: demux_realaudio.c,v 1.29 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -293,7 +293,7 @@ static void demux_ra_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->wave.nSamplesPerSec; buf->decoder_info[2] = this->wave.wBitsPerSample; diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index 13672c88d..490674be2 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -23,7 +23,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: demux_roq.c,v 1.49 2003/11/26 23:44:09 f1rmb Exp $ + * $Id: demux_roq.c,v 1.50 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -325,7 +325,7 @@ static void demux_roq_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->frame_pts_inc; /* initial video_step */ buf->size = sizeof(xine_bmiheader); @@ -341,7 +341,7 @@ static void demux_roq_send_headers(demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_ROQ; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = RoQ_AUDIO_SAMPLE_RATE; buf->decoder_info[2] = 16; diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index 3734e18d0..3e40576d4 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -23,7 +23,7 @@ * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 * - * $Id: demux_smjpeg.c,v 1.47 2003/11/26 23:44:09 f1rmb Exp $ + * $Id: demux_smjpeg.c,v 1.48 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -331,7 +331,7 @@ static void demux_smjpeg_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = 3000; /* initial video_step */ memcpy(buf->content, &this->bih, sizeof(this->bih)); @@ -342,7 +342,7 @@ static void demux_smjpeg_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->audio_sample_rate; buf->decoder_info[2] = this->audio_bits; diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index dea265fb4..ea7e9d901 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -21,7 +21,7 @@ /* * SND/AU File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_snd.c,v 1.37 2003/12/05 15:54:57 f1rmb Exp $ + * $Id: demux_snd.c,v 1.38 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -224,7 +224,7 @@ static void demux_snd_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->audio_sample_rate; buf->decoder_info[2] = this->audio_bits; diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index b4f291906..612dc33f5 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -24,7 +24,7 @@ * This demuxer handles either raw STR files (which are just a concatenation * of raw compact disc sectors) or STR files with RIFF headers. * - * $Id: demux_str.c,v 1.22 2003/11/26 23:44:09 f1rmb Exp $ + * $Id: demux_str.c,v 1.23 2004/01/09 01:26:33 miguelfreitas Exp $ */ /* @@ -459,7 +459,7 @@ static void demux_str_send_headers(demux_plugin_t *this_gen) { /* send init info to video decoder */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = FRAME_DURATION; /* initial video_step */ buf->size = sizeof(xine_bmiheader); @@ -483,7 +483,7 @@ static void demux_str_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_XA_ADPCM | channel; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = (audio_info & 0x04) ? 18900 : 37800; buf->decoder_info[2] = (audio_info & 0x10) ? 1 : 0; diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index 4d909eeb8..fe234176f 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -25,7 +25,7 @@ * It will only play that block if it is PCM data. More variations will be * supported as they are encountered. * - * $Id: demux_voc.c,v 1.37 2003/12/05 15:54:57 f1rmb Exp $ + * $Id: demux_voc.c,v 1.38 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -218,7 +218,7 @@ static void demux_voc_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->audio_sample_rate; buf->decoder_info[2] = this->audio_bits; diff --git a/src/demuxers/demux_vox.c b/src/demuxers/demux_vox.c index 4a57231e3..64846c2ba 100644 --- a/src/demuxers/demux_vox.c +++ b/src/demuxers/demux_vox.c @@ -22,7 +22,7 @@ * VOX Demuxer by Mike Melanson (melanson@pcisys.net) * This a demuxer for .vox files containing raw Dialogic ADPCM data. * - * $Id: demux_vox.c,v 1.11 2003/11/16 23:33:44 f1rmb Exp $ + * $Id: demux_vox.c,v 1.12 2004/01/09 01:26:33 miguelfreitas Exp $ * */ @@ -124,7 +124,7 @@ static void demux_vox_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_DIALOGIC_IMA; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = DIALOGIC_SAMPLERATE; buf->decoder_info[2] = 16; diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index bd4ba6297..92de1539b 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -29,7 +29,7 @@ * block needs information from the previous audio block in order to be * decoded, thus making random seeking difficult. * - * $Id: demux_vqa.c,v 1.38 2003/11/16 23:33:44 f1rmb Exp $ + * $Id: demux_vqa.c,v 1.39 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -269,7 +269,7 @@ static void demux_vqa_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = VQA_PTS_INC; /* initial video_step */ memcpy(buf->content, this->bih, sizeof(xine_bmiheader) + VQA_HEADER_SIZE); @@ -280,7 +280,7 @@ static void demux_vqa_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->wave.nChannels) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_VQA_IMA; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->wave.nSamplesPerSec; buf->decoder_info[2] = 16; /* bits/samples */ diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 326a9da45..9f5d9a7f9 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -22,7 +22,7 @@ * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide * - * $Id: demux_wav.c,v 1.53 2003/11/16 23:33:44 f1rmb Exp $ + * $Id: demux_wav.c,v 1.54 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -284,7 +284,7 @@ static void demux_wav_send_headers(demux_plugin_t *this_gen) { if (this->audio_fifo && this->audio_type) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->wave->nSamplesPerSec; buf->decoder_info[2] = this->wave->wBitsPerSample; diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index ea97b97e9..0d75ee12b 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -24,7 +24,7 @@ * For more information on the MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_wc3movie.c,v 1.49 2003/12/05 15:54:57 f1rmb Exp $ + * $Id: demux_wc3movie.c,v 1.50 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -194,7 +194,7 @@ static int demux_mve_send_chunk(demux_plugin_t *this_gen) { } buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_flags = BUF_FLAG_SPECIAL|BUF_FLAG_HEADER; buf->decoder_info[1] = BUF_SPECIAL_PALETTE; buf->decoder_info[2] = PALETTE_SIZE; buf->decoder_info_ptr[2] = &this->palettes[PALETTE_SIZE * palette_number]; @@ -312,7 +312,7 @@ static void demux_mve_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = WC3_PTS_INC; /* initial video_step */ buf->content = (void *)&this->bih; @@ -330,7 +330,7 @@ static void demux_mve_send_headers(demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_LPCM_LE; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->wave.nSamplesPerSec; buf->decoder_info[2] = this->wave.wBitsPerSample; diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c index ab86e492a..affc0818a 100644 --- a/src/demuxers/demux_yuv4mpeg2.c +++ b/src/demuxers/demux_yuv4mpeg2.c @@ -24,7 +24,7 @@ * tools, visit: * http://mjpeg.sourceforge.net/ * - * $Id: demux_yuv4mpeg2.c,v 1.33 2003/11/29 15:15:35 miguelfreitas Exp $ + * $Id: demux_yuv4mpeg2.c,v 1.34 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -313,7 +313,7 @@ static void demux_yuv4mpeg2_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = this->progressive; buf->decoder_info[1] = this->frame_pts_inc; /* initial video step */ buf->decoder_info[2] = this->top_field_first; diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index f91b3f99c..a98cc0db0 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -20,7 +20,7 @@ * Compact Disc Digital Audio (CDDA) Input Plugin * by Mike Melanson (melanson@pcisys.net) * - * $Id: input_cdda.c,v 1.42 2004/01/07 22:21:40 hadess Exp $ + * $Id: input_cdda.c,v 1.43 2004/01/09 01:26:33 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -50,9 +50,9 @@ #define LOG_MODULE "input_cdda" #define LOG_VERBOSE - +/* #define LOG - +*/ #include "xine_internal.h" #include "xineutils.h" diff --git a/src/libdivx4/xine_decoder.c b/src/libdivx4/xine_decoder.c index 3017582a9..b5fe974d4 100644 --- a/src/libdivx4/xine_decoder.c +++ b/src/libdivx4/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.48 2003/12/09 00:02:31 f1rmb Exp $ + * $Id: xine_decoder.c,v 1.49 2004/01/09 01:26:33 miguelfreitas Exp $ * * xine decoder plugin using divx4 * @@ -368,7 +368,7 @@ static void divx4_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ /* only proceed if version is good and initialization succeeded */ lprintf ("get_version...\n"); diff --git a/src/libfaad/xine_decoder.c b/src/libfaad/xine_decoder.c index 59ca1f3fc..2135dba09 100644 --- a/src/libfaad/xine_decoder.c +++ b/src/libfaad/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.26 2004/01/04 16:19:45 tmattern Exp $ + * $Id: xine_decoder.c,v 1.27 2004/01/09 01:26:33 miguelfreitas Exp $ * */ @@ -209,7 +209,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { /* get audio parameters from file header (may be overwritten by libfaad returned parameters) */ - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { this->rate=buf->decoder_info[1]; this->bits_per_sample=buf->decoder_info[2] ; this->num_channels=buf->decoder_info[3] ; diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index 1331b57a5..f920a9851 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.148 2004/01/03 14:50:13 tmmm Exp $ + * $Id: xine_decoder.c,v 1.149 2004/01/09 01:26:33 miguelfreitas Exp $ * * xine decoder plugin using ffmpeg * @@ -768,7 +768,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { return; } - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { lprintf ("header\n"); @@ -1358,7 +1358,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) audio_buffer_t *audio_buffer; int bytes_to_send; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { int codec_type; xine_waveformatex *audio_header = (xine_waveformatex *)buf->content; diff --git a/src/libflac/decoder_flac.c b/src/libflac/decoder_flac.c index ce7d56c78..046559d7b 100644 --- a/src/libflac/decoder_flac.c +++ b/src/libflac/decoder_flac.c @@ -241,7 +241,7 @@ flac_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) /* We are getting the stream header, open up the audio * device, and collect information about the stream */ - if (buf->decoder_flags & BUF_FLAG_HEADER) + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { int mode = AO_CAP_MODE_MONO; diff --git a/src/libflac/demux_flac.c b/src/libflac/demux_flac.c index 805a0fb76..30fc0315f 100644 --- a/src/libflac/demux_flac.c +++ b/src/libflac/demux_flac.c @@ -359,7 +359,7 @@ demux_flac_send_headers (demux_plugin_t *this_gen) { if (this->audio_fifo) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_FLAC; - buf->decoder_flags = BUF_FLAG_HEADER; + buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->sample_rate; buf->decoder_info[2] = this->bits_per_sample; diff --git a/src/liblpcm/xine_decoder.c b/src/liblpcm/xine_decoder.c index eca07fe74..24498f328 100644 --- a/src/liblpcm/xine_decoder.c +++ b/src/liblpcm/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.49 2003/12/14 22:13:23 siggi Exp $ + * $Id: xine_decoder.c,v 1.50 2004/01/09 01:26:33 miguelfreitas Exp $ * * 31-8-2001 Added LPCM rate sensing. * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -109,7 +109,7 @@ static void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { } } - if( buf->decoder_flags & BUF_FLAG_HEADER ) { + if( buf->decoder_flags & BUF_FLAG_STDHEADER ) { this->rate=buf->decoder_info[1]; this->bits_per_sample=buf->decoder_info[2] ; this->number_of_channels=buf->decoder_info[3] ; diff --git a/src/libspeex/xine_decoder.c b/src/libspeex/xine_decoder.c index 36279e4d9..5a834c8b4 100644 --- a/src/libspeex/xine_decoder.c +++ b/src/libspeex/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.9 2003/12/14 22:13:24 siggi Exp $ + * $Id: xine_decoder.c,v 1.10 2004/01/09 01:26:33 miguelfreitas Exp $ * * (ogg/)speex audio decoder plugin (libspeex wrapper) for xine */ @@ -197,7 +197,8 @@ static void speex_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { lprintf ("decode buf=%8p content=%8p flags=%08x\n", buf, buf->content, buf->decoder_flags); - if (buf->decoder_flags & BUF_FLAG_PREVIEW) { + if ( (buf->decoder_flags & BUF_FLAG_HEADER) && + !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) { lprintf ("preview buffer, %d headers to go\n", this->header_count); if (this->header_count) { diff --git a/src/libtheora/xine_decoder.c b/src/libtheora/xine_decoder.c index c378bc905..4f30eff91 100644 --- a/src/libtheora/xine_decoder.c +++ b/src/libtheora/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.19 2003/12/14 22:13:24 siggi Exp $ + * $Id: xine_decoder.c,v 1.20 2004/01/09 01:26:33 miguelfreitas Exp $ * * xine decoder plugin using libtheora * @@ -171,7 +171,8 @@ static void theora_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if (!collect_data(this, buf)) return; /*return, until a entire packets is collected*/ - if ( (buf->decoder_flags & BUF_FLAG_PREVIEW) ) { + if ( (buf->decoder_flags & BUF_FLAG_HEADER) && + !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) { /*get the first 3 packets and decode the header during preview*/ diff --git a/src/libvorbis/xine_decoder.c b/src/libvorbis/xine_decoder.c index 3d6cdc18d..ad3195487 100644 --- a/src/libvorbis/xine_decoder.c +++ b/src/libvorbis/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.37 2003/12/14 22:13:24 siggi Exp $ + * $Id: xine_decoder.c,v 1.38 2004/01/09 01:26:34 miguelfreitas Exp $ * * (ogg/)vorbis audio decoder plugin (libvorbis wrapper) for xine */ @@ -141,8 +141,9 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->op.packet = buf->content; this->op.bytes = buf->size; - if (buf->decoder_flags & BUF_FLAG_PREVIEW) { - lprintf ("preview buffer, %d headers to go\n", this->header_count); + if ( (buf->decoder_flags & BUF_FLAG_HEADER) && + !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) { + lprintf ("%d headers to go\n", this->header_count); if (this->header_count) { diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c index 489bcea1c..e9e64fb40 100644 --- a/src/libw32dll/qt_decoder.c +++ b/src/libw32dll/qt_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: qt_decoder.c,v 1.30 2003/12/24 16:55:35 mroi Exp $ + * $Id: qt_decoder.c,v 1.31 2004/01/09 01:26:34 miguelfreitas Exp $ * * quicktime video/audio decoder plugin, using win32 dlls * most of this code comes directly from MPlayer @@ -443,7 +443,7 @@ static void qta_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { lprintf ("audio: decode buf=%08x %d bytes flags=%08x pts=%lld\n", buf, buf->size, buf->decoder_flags, buf->pts); - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { memcpy (&this->wave, buf->content, sizeof (xine_waveformatex)); @@ -964,7 +964,7 @@ static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { lprintf ("video: decode_data, flags=0x%08x, len=%d, pts=%lld ...\n", buf->decoder_flags, buf->size, buf->pts); - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { lprintf ("video: copying bih\n"); memcpy (&this->bih, buf->content, sizeof (xine_bmiheader)); diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 072e9f87c..fe42a4d1d 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: w32codec.c,v 1.136 2003/12/24 16:55:36 mroi Exp $ + * $Id: w32codec.c,v 1.137 2004/01/09 01:26:34 miguelfreitas Exp $ * * routines for using w32 codecs * DirectShow support by Miguel Freitas (Nov/2001) @@ -750,7 +750,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { int num_decoders; if ( buf->type & 0xff ) @@ -1448,7 +1448,7 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { return; } - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { lprintf ("got audio header\n"); pthread_mutex_lock(&win32_codec_mutex); diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c index be936e20f..88953becb 100644 --- a/src/libxineadec/adpcm.c +++ b/src/libxineadec/adpcm.c @@ -31,7 +31,7 @@ * this is also useful for extracting streams from Playstation discs * * - * $Id: adpcm.c,v 1.36 2003/12/14 22:13:24 siggi Exp $ + * $Id: adpcm.c,v 1.37 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -1370,7 +1370,7 @@ static void xa_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) { static void adpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { adpcm_decoder_t *this = (adpcm_decoder_t *) this_gen; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { xine_waveformatex *audio_header; this->rate = buf->decoder_info[1]; diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c index 724f84a83..8c84b0226 100644 --- a/src/libxineadec/fooaudio.c +++ b/src/libxineadec/fooaudio.c @@ -21,7 +21,7 @@ * player. It really works too! It will output a continuous sine wave in * place of the data it should actually send. * - * $Id: fooaudio.c,v 1.10 2003/12/14 22:13:24 siggi Exp $ + * $Id: fooaudio.c,v 1.11 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -82,7 +82,7 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) int64_t samples_to_generate; int samples_to_send; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* When the engine sends a BUF_FLAG_HEADER flag, it is time to initialize * the decoder. The buffer element type has 4 decoder_info fields, diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c index ef76c322e..4d600a7cf 100644 --- a/src/libxineadec/gsm610.c +++ b/src/libxineadec/gsm610.c @@ -44,7 +44,7 @@ * Carsten Bormann * -------------------------------------------------------------------- * - * $Id: gsm610.c,v 1.13 2003/12/14 22:13:24 siggi Exp $ + * $Id: gsm610.c,v 1.14 2004/01/09 01:26:34 miguelfreitas Exp $ * */ @@ -101,7 +101,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { audio_buffer_t *audio_buffer; int in_ptr; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { this->sample_rate = buf->decoder_info[1]; this->buf = xine_xmalloc(AUDIOBUFSIZE); diff --git a/src/libxineadec/interplayaudio.c b/src/libxineadec/interplayaudio.c index 59bb34268..4dd8a4a2e 100644 --- a/src/libxineadec/interplayaudio.c +++ b/src/libxineadec/interplayaudio.c @@ -21,7 +21,7 @@ * For more information regarding the Interplay MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: interplayaudio.c,v 1.6 2003/12/14 22:13:24 siggi Exp $ + * $Id: interplayaudio.c,v 1.7 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -121,7 +121,7 @@ static void interplay_decode_data (audio_decoder_t *this_gen, buf_element_t *buf int sequence_number; int channel_number = 0; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* When the engine sends a BUF_FLAG_HEADER flag, it is time to initialize * the decoder. The buffer element type has 4 decoder_info fields, diff --git a/src/libxineadec/logpcm.c b/src/libxineadec/logpcm.c index b8ecf42c1..a980806fb 100644 --- a/src/libxineadec/logpcm.c +++ b/src/libxineadec/logpcm.c @@ -30,7 +30,7 @@ * http://sox.sourceforge.net/ * which listed the code as being lifted from Sun Microsystems. * - * $Id: logpcm.c,v 1.17 2003/12/14 22:13:24 siggi Exp $ + * $Id: logpcm.c,v 1.18 2004/01/09 01:26:34 miguelfreitas Exp $ * */ @@ -151,7 +151,7 @@ static void logpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { int i; int bytes_to_send; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { this->samplerate = buf->decoder_info[1]; this->output_channels = buf->decoder_info[3]; diff --git a/src/libxineadec/roqaudio.c b/src/libxineadec/roqaudio.c index 4bd8455bb..ba2f683d4 100644 --- a/src/libxineadec/roqaudio.c +++ b/src/libxineadec/roqaudio.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: roqaudio.c,v 1.20 2003/12/14 22:13:25 siggi Exp $ + * $Id: roqaudio.c,v 1.21 2004/01/09 01:26:34 miguelfreitas Exp $ * */ @@ -75,7 +75,7 @@ static void roqaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) int predictor[2]; int channel_number = 0; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { this->output_channels = buf->decoder_info[3]; this->buf = xine_xmalloc(AUDIOBUFSIZE); diff --git a/src/libxinevdec/cinepak.c b/src/libxinevdec/cinepak.c index e625a0745..16b2e6957 100644 --- a/src/libxinevdec/cinepak.c +++ b/src/libxinevdec/cinepak.c @@ -22,7 +22,7 @@ * based on overview of Cinepak algorithm and example decoder * by Tim Ferguson: http://www.csse.monash.edu.au/~timf/ * - * $Id: cinepak.c,v 1.35 2003/12/14 22:13:25 siggi Exp $ + * $Id: cinepak.c,v 1.36 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdlib.h> @@ -388,7 +388,7 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } } - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { xine_bmiheader *bih; int chroma_size; diff --git a/src/libxinevdec/cyuv.c b/src/libxinevdec/cyuv.c index 1711dde0f..e1657dfe1 100644 --- a/src/libxinevdec/cyuv.c +++ b/src/libxinevdec/cyuv.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: cyuv.c,v 1.23 2003/12/14 22:13:25 siggi Exp $ + * $Id: cyuv.c,v 1.24 2004/01/09 01:26:34 miguelfreitas Exp $ */ /* And this is the header that came with the CYUV decoder: */ @@ -148,7 +148,7 @@ static void cyuv_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & (BUF_FLAG_PREVIEW | BUF_FLAG_SPECIAL)) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index 526bfb60b..40916d8d7 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -23,7 +23,7 @@ * value from the last frame. This creates a slowly rotating solid color * frame when the frames are played in succession. * - * $Id: foovideo.c,v 1.19 2003/12/14 22:13:25 siggi Exp $ + * $Id: foovideo.c,v 1.20 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -92,7 +92,7 @@ static void foovideo_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/idcinvideo.c b/src/libxinevdec/idcinvideo.c index c3db3f090..21436886b 100644 --- a/src/libxinevdec/idcinvideo.c +++ b/src/libxinevdec/idcinvideo.c @@ -21,7 +21,7 @@ * the Id CIN format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: idcinvideo.c,v 1.20 2003/12/14 22:13:25 siggi Exp $ + * $Id: idcinvideo.c,v 1.21 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -234,7 +234,7 @@ static void idcinvideo_decode_data (video_decoder_t *this_gen, } } - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ xine_bmiheader *bih = (xine_bmiheader *)buf->content; this->stream->video_out->open (this->stream->video_out, this->stream); diff --git a/src/libxinevdec/interplayvideo.c b/src/libxinevdec/interplayvideo.c index d7b171ccc..3b955ae3a 100644 --- a/src/libxinevdec/interplayvideo.c +++ b/src/libxinevdec/interplayvideo.c @@ -21,7 +21,7 @@ * For more information regarding the Interplay MVE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: interplayvideo.c,v 1.9 2003/12/14 22:13:25 siggi Exp $ + * $Id: interplayvideo.c,v 1.10 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -1151,7 +1151,7 @@ static void interplay_decode_data (video_decoder_t *this_gen, } } - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/msrle.c b/src/libxinevdec/msrle.c index b314a1303..24c6234c7 100644 --- a/src/libxinevdec/msrle.c +++ b/src/libxinevdec/msrle.c @@ -21,7 +21,7 @@ * For more information on the MS RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: msrle.c,v 1.23 2003/12/14 22:13:25 siggi Exp $ + * $Id: msrle.c,v 1.24 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -207,7 +207,7 @@ static void msrle_decode_data (video_decoder_t *this_gen, } } - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/msvc.c b/src/libxinevdec/msvc.c index 2f92180d0..235028057 100644 --- a/src/libxinevdec/msvc.c +++ b/src/libxinevdec/msvc.c @@ -22,7 +22,7 @@ * based on overview of Microsoft Video-1 algorithm * by Mike Melanson: http://www.pcisys.net/~melanson/codecs/video1.txt * - * $Id: msvc.c,v 1.27 2003/12/14 22:13:25 siggi Exp $ + * $Id: msvc.c,v 1.28 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdlib.h> @@ -223,7 +223,7 @@ static void msvc_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { &this->color_table[i]); } - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { xine_bmiheader *bih; int image_size; diff --git a/src/libxinevdec/qtrle.c b/src/libxinevdec/qtrle.c index b994c3729..69f3f0a9c 100644 --- a/src/libxinevdec/qtrle.c +++ b/src/libxinevdec/qtrle.c @@ -21,7 +21,7 @@ * For more information on the QT RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrle.c,v 1.17 2003/12/14 22:13:25 siggi Exp $ + * $Id: qtrle.c,v 1.18 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -837,7 +837,7 @@ static void qtrle_decode_data (video_decoder_t *this_gen, } } - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/qtrpza.c b/src/libxinevdec/qtrpza.c index f13986917..50d45f80b 100644 --- a/src/libxinevdec/qtrpza.c +++ b/src/libxinevdec/qtrpza.c @@ -21,7 +21,7 @@ * For more information about the RPZA format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrpza.c,v 1.21 2003/12/14 22:13:25 siggi Exp $ + * $Id: qtrpza.c,v 1.22 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -299,7 +299,7 @@ static void qtrpza_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/qtsmc.c b/src/libxinevdec/qtsmc.c index 6ac2256d9..45b5ff229 100644 --- a/src/libxinevdec/qtsmc.c +++ b/src/libxinevdec/qtsmc.c @@ -23,7 +23,7 @@ * For more information on the SMC format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtsmc.c,v 1.21 2003/12/14 22:13:25 siggi Exp $ + * $Id: qtsmc.c,v 1.22 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -531,7 +531,7 @@ static void qtsmc_decode_data (video_decoder_t *this_gen, } } - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 6161fc1f4..156fe452c 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.23 2003/12/14 22:13:25 siggi Exp $ + * $Id: rgb.c,v 1.24 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -99,7 +99,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, } } - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxinevdec/roqvideo.c b/src/libxinevdec/roqvideo.c index cc6e81dd1..a90f75871 100644 --- a/src/libxinevdec/roqvideo.c +++ b/src/libxinevdec/roqvideo.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: roqvideo.c,v 1.25 2003/12/14 22:13:25 siggi Exp $ + * $Id: roqvideo.c,v 1.26 2004/01/09 01:26:34 miguelfreitas Exp $ */ /* And this is the header that came with the RoQ video decoder: */ @@ -390,7 +390,7 @@ static void roqvideo_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ xine_bmiheader *bih = (xine_bmiheader *)buf->content; this->stream->video_out->open (this->stream->video_out, this->stream); diff --git a/src/libxinevdec/svq1.c b/src/libxinevdec/svq1.c index 206ec8607..c30b04935 100644 --- a/src/libxinevdec/svq1.c +++ b/src/libxinevdec/svq1.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: svq1.c,v 1.29 2003/12/14 22:13:25 siggi Exp $ + * $Id: svq1.c,v 1.30 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -1327,7 +1327,7 @@ static void svq1dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { this->video_step = buf->decoder_info[1]; if (this->buf) diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index aba87bdcf..2885b0cc7 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -21,7 +21,7 @@ * Actually, this decoder just reorganizes chunks of raw YUV data in such * a way that xine can display them. * - * $Id: yuv.c,v 1.27 2004/01/07 22:28:34 jstembridge Exp $ + * $Id: yuv.c,v 1.28 2004/01/09 01:26:34 miguelfreitas Exp $ */ #include <stdio.h> @@ -86,7 +86,7 @@ static void yuv_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) diff --git a/src/libxvid/xine_decoder.c b/src/libxvid/xine_decoder.c index 32e2847c0..6acecf747 100644 --- a/src/libxvid/xine_decoder.c +++ b/src/libxvid/xine_decoder.c @@ -85,7 +85,7 @@ static void xvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { lprintf ("processing packet type = %08x, buf: %08x, buf->decoder_flags=%08x\n", buf->type, buf, buf->decoder_flags); - if (buf->decoder_flags & BUF_FLAG_HEADER) { + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { xine_bmiheader *bih; XVID_DEC_PARAM xparam; diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 968ea065b..ffccf247e 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_decoder.c,v 1.118 2003/12/09 00:02:35 f1rmb Exp $ + * $Id: audio_decoder.c,v 1.119 2004/01/09 01:26:34 miguelfreitas Exp $ * * * functions that implement audio decoding @@ -46,11 +46,15 @@ static void *audio_decoder_loop (void *stream_gen) { - buf_element_t *buf; + buf_element_t *buf = NULL; + buf_element_t *first_header = NULL; + buf_element_t *last_header = NULL; + int replaying_headers = 0; xine_stream_t *stream = (xine_stream_t *) stream_gen; int running = 1; int prof_audio_decode = -1; uint32_t buftype_unknown = 0; + int audio_channel_user = stream->audio_channel_user; if (prof_audio_decode == -1) prof_audio_decode = xine_profiler_allocate_slot ("audio decoder/output"); @@ -59,7 +63,8 @@ static void *audio_decoder_loop (void *stream_gen) { lprintf ("audio_loop: waiting for package...\n"); - buf = stream->audio_fifo->get (stream->audio_fifo); + if( !replaying_headers ) + buf = stream->audio_fifo->get (stream->audio_fifo); lprintf ("audio_loop: got package pts = %lld, type = %08x\n", buf->pts, buf->type); @@ -114,6 +119,19 @@ static void *audio_decoder_loop (void *stream_gen) { case BUF_CONTROL_END: + /* free all held header buffers, see comments below */ + if( first_header ) { + buf_element_t *cur, *next; + + cur = first_header; + while( cur ) { + next = cur->next; + cur->free_buffer (cur); + cur = next; + } + first_header = last_header = NULL; + } + /* wait for video to reach this marker, if necessary */ pthread_mutex_lock (&stream->counter_lock); @@ -189,6 +207,7 @@ static void *audio_decoder_loop (void *stream_gen) { } break; + default: if (_x_stream_info_get(stream, XINE_STREAM_INFO_IGNORE_AUDIO)) @@ -205,7 +224,7 @@ static void *audio_decoder_loop (void *stream_gen) { printf("audio_decoder: buf_type=%08x auto=%08x user=%08x\n", buf->type, stream->audio_channel_auto, - stream->audio_channel_user); + audio_channel_user); */ /* update track map */ @@ -233,12 +252,12 @@ static void *audio_decoder_loop (void *stream_gen) { /* find out which audio type to decode */ lprintf ("audio_channel_user = %d, map[0]=%08x\n", - stream->audio_channel_user, + audio_channel_user, stream->audio_track_map[0]); - if (stream->audio_channel_user > -2) { + if (audio_channel_user > -2) { - if (stream->audio_channel_user == -1) { + if (audio_channel_user == -1) { /* auto */ @@ -255,8 +274,8 @@ static void *audio_decoder_loop (void *stream_gen) { audio_type = stream->audio_track_map[0]; } else { - if (stream->audio_channel_user <= stream->audio_track_map_entries) - audio_type = stream->audio_track_map[stream->audio_channel_user]; + if (audio_channel_user <= stream->audio_track_map_entries) + audio_type = stream->audio_track_map[audio_channel_user]; else audio_type = -1; } @@ -328,8 +347,53 @@ static void *audio_decoder_loop (void *stream_gen) { xine_profiler_stop_count (prof_audio_decode); } - - buf->free_buffer (buf); + + /* some decoders require a full reinitialization when audio + * channel is changed (rate might be change and even a + * different codec may be used). + * + * we must close the old decoder and process all the headers + * again, since they are needed for decoder initialization. + */ + if( audio_channel_user != stream->audio_channel_user && + !replaying_headers ) { + audio_channel_user = stream->audio_channel_user; + + if (stream->audio_decoder_plugin) { + _x_free_audio_decoder (stream, stream->audio_decoder_plugin); + stream->audio_decoder_plugin = NULL; + stream->audio_track_map_entries = 0; + stream->audio_type = 0; + } + + buf->free_buffer (buf); + if( first_header ) { + replaying_headers = 1; + buf = first_header; + } else { + replaying_headers = 0; + } + } else if( !replaying_headers ) { + + /* header buffers are never freed. instead they + * are added to a list to allow replaying them + * in case of a channel change. + */ + if( (buf->decoder_flags & BUF_FLAG_HEADER) ) { + if( last_header ) + last_header->next = buf; + else + first_header = buf; + buf->next = NULL; + last_header = buf; + } else { + buf->free_buffer (buf); + } + } else { + buf = buf->next; + if( !buf ) + replaying_headers = 0; + } } return NULL; diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 4860ed27f..2743d701a 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: buffer.h,v 1.127 2003/12/13 11:35:07 valtri Exp $ + * $Id: buffer.h,v 1.128 2004/01/09 01:26:34 miguelfreitas Exp $ * * * contents: @@ -282,19 +282,44 @@ struct buf_element_s { } ; +/* keyframe should be set whenever possible (that is, when demuxer + * knows about frames and keyframes). */ #define BUF_FLAG_KEYFRAME 0x0001 + +/* frame start/end. BUF_FLAG_FRAME_END is sent on last buf of a frame */ #define BUF_FLAG_FRAME_START 0x0002 #define BUF_FLAG_FRAME_END 0x0004 + +/* any out-of-band data needed to initialize decoder must have + * this flag set. */ #define BUF_FLAG_HEADER 0x0008 + +/* preview buffers are normal data buffers that must not produce any + * output in decoders (may be used to sneak details about the stream + * to come). */ #define BUF_FLAG_PREVIEW 0x0010 + +/* set when user stop the playback */ #define BUF_FLAG_END_USER 0x0020 + +/* set when stream finished naturaly */ #define BUF_FLAG_END_STREAM 0x0040 + +/* decoder_info[0] carries the frame step (1/90000). */ #define BUF_FLAG_FRAMERATE 0x0080 + +/* hint to metronom that seeking has occurred */ #define BUF_FLAG_SEEK 0x0100 + +/* special information inside, see below. */ #define BUF_FLAG_SPECIAL 0x0200 -#define BUF_FLAG_NO_VIDEO 0x0400 -/* do not decode the buffer contents, detect framing only */ -#define BUF_FLAG_FRAMING 0x0800 + +/* header use standard xine_bmiheader or xine_waveformatex structs. + * xine_waveformatex is actually optional since the most important + * information for audio init is available from decoder_info[]. + * note: BUF_FLAG_HEADER must also be set. */ +#define BUF_FLAG_STDHEADER 0x0400 + /* Special buffer types: * Sometimes there is a need to relay special information from a demuxer |