diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_avi.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_film.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 32 | ||||
-rw-r--r-- | src/demuxers/demux_qt.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_smjpeg.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_wav.c | 5 | ||||
-rw-r--r-- | src/liblpcm/xine_decoder.c | 12 |
7 files changed, 36 insertions, 33 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 7eff7c06d..5f379de14 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.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_avi.c,v 1.103 2002/07/16 19:41:17 miguelfreitas Exp $ + * $Id: demux_avi.c,v 1.104 2002/07/17 18:17:48 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -1068,9 +1068,6 @@ static int demux_avi_next (demux_avi_t *this) { buf->input_time = 0; buf->type = audio->audio_type | i; - buf->decoder_info[1] = audio->wavex->nSamplesPerSec; /* audio Rate */ - buf->decoder_info[2] = audio->wavex->wBitsPerSample; /* audio bits */ - buf->decoder_info[3] = audio->wavex->nChannels; /* audio channels */ if(this->audio_fifo) { this->audio_fifo->put (this->audio_fifo, buf); diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 0fd986dbf..f4aa0fd92 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.18 2002/07/14 22:27:25 miguelfreitas Exp $ + * $Id: demux_film.c,v 1.19 2002/07/17 18:17:48 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -458,9 +458,6 @@ static void *demux_film_loop (void *this_gen) { if (!remaining_sample_bytes) buf->decoder_flags |= BUF_FLAG_FRAME_END; - buf->decoder_info[1] = this->sample_rate; - buf->decoder_info[2] = this->audio_bits; - buf->decoder_info[3] = this->audio_channels; this->audio_fifo->put(this->audio_fifo, buf); } } diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 97480b5e9..1f9144505 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.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_mpeg_block.c,v 1.107 2002/07/14 22:27:25 miguelfreitas Exp $ + * $Id: demux_mpeg_block.c,v 1.108 2002/07/17 18:17:48 miguelfreitas Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -90,6 +90,12 @@ typedef struct demux_mpeg_block_s { int64_t last_pts[2]; int send_newpts; int buf_flag_seek; + + + int pcm_bits; + int pcm_rate; + int pcm_channels; + } demux_mpeg_block_t ; @@ -582,9 +588,25 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m } dynamic_range = p[6]; - buf->decoder_info[1] = sample_rate; - buf->decoder_info[2] = bits_per_sample; - buf->decoder_info[3] = num_channels; + /* send header with audio parameters */ + if( !preview_mode && + (this->pcm_rate != sample_rate || + this->pcm_bits != bits_per_sample || + this->pcm_channels != num_channels) ) { + + buf_element_t *buf2; + + buf2 = this->video_fifo->buffer_pool_alloc (this->video_fifo); + + buf2->type = BUF_AUDIO_LPCM_BE + track; + buf2->decoder_flags = BUF_FLAG_HEADER; + + buf2->decoder_info[1] = this->pcm_rate = sample_rate; + buf2->decoder_info[2] = this->pcm_bits = bits_per_sample; + buf2->decoder_info[3] = this->pcm_channels = num_channels; + + this->video_fifo->put(this->video_fifo, buf2); + } pcm_offset = 7; @@ -912,6 +934,8 @@ static int demux_mpeg_block_start (demux_plugin_t *this_gen, this->video_fifo = video_fifo; this->audio_fifo = audio_fifo; + this->pcm_bits = this->pcm_rate = this->pcm_channels = 0; + if((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) != 0) { if (!this->blocksize) this->blocksize = demux_mpeg_detect_blocksize( this, this->input ); diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 473745740..c5460f706 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.67 2002/07/16 17:32:30 miguelfreitas Exp $ + * $Id: demux_qt.c,v 1.68 2002/07/17 18:17:49 miguelfreitas Exp $ * */ @@ -1257,9 +1257,6 @@ static void *demux_qt_loop (void *this_gen) { if (!remaining_sample_bytes) buf->decoder_flags |= BUF_FLAG_FRAME_END; - buf->decoder_info[1] = this->qt->audio_sample_rate; - buf->decoder_info[2] = this->qt->audio_bits; - buf->decoder_info[3] = this->qt->audio_channels; this->audio_fifo->put(this->audio_fifo, buf); } } diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index 6a55c935f..d9cc2fa0b 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -21,7 +21,7 @@ * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 * - * $Id: demux_smjpeg.c,v 1.3 2002/07/14 22:27:25 miguelfreitas Exp $ + * $Id: demux_smjpeg.c,v 1.4 2002/07/17 18:17:49 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -156,9 +156,6 @@ static void *demux_smjpeg_loop (void *this_gen) { if (chunk_tag == sndD_TAG) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = this->audio_type; - buf->decoder_info[1] = this->audio_sample_rate; - buf->decoder_info[2] = this->audio_bits; - buf->decoder_info[3] = this->audio_channels; } else { buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = this->video_type; diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 348bef490..f39ff4223 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -20,7 +20,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.4 2002/07/14 22:27:25 miguelfreitas Exp $ + * $Id: demux_wav.c,v 1.5 2002/07/17 18:17:49 miguelfreitas Exp $ * */ @@ -140,9 +140,6 @@ static void *demux_wav_loop (void *this_gen) { if (!remaining_sample_bytes) buf->decoder_flags |= BUF_FLAG_FRAME_END; - buf->decoder_info[1] = this->wave->nSamplesPerSec; - buf->decoder_info[2] = this->wave->wBitsPerSample; - buf->decoder_info[3] = this->wave->nChannels; this->audio_fifo->put (this->audio_fifo, buf); } } diff --git a/src/liblpcm/xine_decoder.c b/src/liblpcm/xine_decoder.c index f41c8ebc6..a8328906b 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.28 2002/07/05 17:32:03 mroi Exp $ + * $Id: xine_decoder.c,v 1.29 2002/07/17 18:17:49 miguelfreitas Exp $ * * 31-8-2001 Added LPCM rate sensing. * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -89,17 +89,11 @@ void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { /* Drop preview data */ if (buf->decoder_flags & BUF_FLAG_PREVIEW) return; - if (buf->decoder_info[1]==0 || buf->decoder_info[2]==0 || buf->decoder_info[3]==0) { - printf ("liblpcm: decoder_info bad. zeros\n"); - return; - } + /* * (re-)open output device */ - if (!this->output_open - || (this->rate != buf->decoder_info[1]) - || (this->bits_per_sample != buf->decoder_info[2]) - || (this->number_of_channels != buf->decoder_info[3]) ) { + if ( buf->decoder_flags & BUF_FLAG_HEADER ) { if (this->output_open) this->audio_out->close (this->audio_out); |