summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2003-10-12 00:06:00 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2003-10-12 00:06:00 +0000
commit04038f811502095f85aec34673e4debc112bfb87 (patch)
treee56387daa7702e0f0f5ad3241d439995b47f2776
parent3c99788d960e74cbb0d9dc8e9f1da55596196c00 (diff)
downloadxine-lib-04038f811502095f85aec34673e4debc112bfb87.tar.gz
xine-lib-04038f811502095f85aec34673e4debc112bfb87.tar.bz2
Fix performance issue with mp3 inside wav streams.
Mike: i know nothing about the wav format, please check if there is a better fix. CVS patchset: 5485 CVS date: 2003/10/12 00:06:00
-rw-r--r--src/demuxers/demux_wav.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index 0315ba640..dc4d1c83e 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.48 2003/09/17 23:57:15 tmmm Exp $
+ * $Id: demux_wav.c,v 1.49 2003/10/12 00:06:00 tmattern Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -48,6 +48,8 @@
#define data_TAG 0x61746164
#define PCM_BLOCK_ALIGN 1024
+#define PREFERED_BLOCK_SIZE 4096
+
typedef struct {
demux_plugin_t demux_plugin;
@@ -179,7 +181,12 @@ static int demux_wav_send_chunk(demux_plugin_t *this_gen) {
/* just load data chunks from wherever the stream happens to be
* pointing; issue a DEMUX_FINISHED status if EOF is reached */
- remaining_sample_bytes = this->wave->nBlockAlign;
+ if (this->wave->nBlockAlign < PREFERED_BLOCK_SIZE) {
+ remaining_sample_bytes = PREFERED_BLOCK_SIZE / this->wave->nBlockAlign *
+ this->wave->nBlockAlign;
+ } else{
+ remaining_sample_bytes = this->wave->nBlockAlign;
+ }
current_file_pos =
this->input->get_current_pos(this->input) - this->data_start;