summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_wav.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_wav.c')
-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 5f39395ad..99c50ad67 100644
--- a/src/demuxers/demux_wav.c
+++ b/src/demuxers/demux_wav.c
@@ -66,6 +66,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;
@@ -186,9 +187,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) {
@@ -289,10 +290,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))