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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index 663176bf2..cfe2b02e2 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.58 2004/05/31 14:44:16 tmmm Exp $
+ * $Id: demux_wav.c,v 1.59 2004/06/13 21:28:55 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -200,7 +200,7 @@ static int demux_wav_send_chunk(demux_plugin_t *this_gen) {
current_pts /= this->wave->nAvgBytesPerSec;
if (this->seek_flag) {
- _x_demux_control_newpts(this->stream, current_pts, 0);
+ _x_demux_control_newpts(this->stream, current_pts, BUF_FLAG_SEEK);
this->seek_flag = 0;
}
@@ -211,8 +211,8 @@ static int demux_wav_send_chunk(demux_plugin_t *this_gen) {
}
buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
- buf->extra_info->input_pos = current_file_pos;
- buf->extra_info->input_length = this->data_size;
+ if( this->data_size )
+ buf->extra_info->input_normpos = (int)( (double) current_file_pos * 65535 / this->data_size);
buf->extra_info->input_time = current_pts / 90;
buf->pts = current_pts;
@@ -304,6 +304,8 @@ static int demux_wav_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time, int playing) {
demux_wav_t *this = (demux_wav_t *) this_gen;
+ start_pos = (off_t) ( (double) start_pos / 65535 *
+ this->data_size );
this->seek_flag = 1;
this->status = DEMUX_OK;