summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThibaut Mattern <thibaut.mattern@gmail.com>2008-01-09 23:43:29 +0100
committerThibaut Mattern <thibaut.mattern@gmail.com>2008-01-09 23:43:29 +0100
commit5d789eac0040b27fd8069be3cdc574a8477f0d51 (patch)
tree29d0e5b101baae7392ba81f76b67fcdb26a54c70 /src
parent26a5fb652acd73958d3933aa5fb330cfaf12cc70 (diff)
downloadxine-lib-5d789eac0040b27fd8069be3cdc574a8477f0d51.tar.gz
xine-lib-5d789eac0040b27fd8069be3cdc574a8477f0d51.tar.bz2
Fixed gapless playback.
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_wav.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index 9b46336fe..33baaf973 100644
--- a/src/demuxers/demux_wav.c
+++ b/src/demuxers/demux_wav.c
@@ -64,6 +64,7 @@ typedef struct {
off_t data_start;
off_t data_size;
+ int send_newpts;
int seek_flag; /* this is set when a seek just occurred */
} demux_wav_t;
@@ -160,9 +161,9 @@ static int demux_wav_send_chunk(demux_plugin_t *this_gen) {
current_pts *= 90000;
current_pts /= this->wave->nAvgBytesPerSec;
- if (this->seek_flag) {
- _x_demux_control_newpts(this->stream, current_pts, BUF_FLAG_SEEK);
- this->seek_flag = 0;
+ if (this->send_newpts) {
+ _x_demux_control_newpts(this->stream, current_pts, this->seek_flag);
+ this->send_newpts = this->seek_flag = 0;
}
while (remaining_sample_bytes) {
@@ -258,10 +259,13 @@ static int demux_wav_seek (demux_plugin_t *this_gen,
start_pos = (off_t) ( (double) start_pos / 65535 *
this->data_size );
- this->seek_flag = 1;
this->status = DEMUX_OK;
- _x_demux_flush_engine (this->stream);
+ this->send_newpts = 1;
+ if (playing) {
+ this->seek_flag = 1;
+ _x_demux_flush_engine (this->stream);
+ }
/* if input is non-seekable, do not proceed with the rest of this
* seek function */
if (!INPUT_IS_SEEKABLE(this->input))