summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_voc.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-06-13 21:28:52 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-06-13 21:28:52 +0000
commitf85a943fdff3f12db8faf4b84e4f63aafdc60db3 (patch)
treee16cc52e6b9a9548714a1ee31a5265ff34127467 /src/demuxers/demux_voc.c
parent62f8ce9ec67fb85da1023b5db90a0a5f1609cff7 (diff)
downloadxine-lib-f85a943fdff3f12db8faf4b84e4f63aafdc60db3.tar.gz
xine-lib-f85a943fdff3f12db8faf4b84e4f63aafdc60db3.tar.bz2
implement steps 1, 2, 3 and 4 of the seeking proposal:
http://article.gmane.org/gmane.comp.video.xine.devel/9532 it is now up to demuxers to decide what the 0..65535 position means. demuxers tested: ogg, voc, flac, rm, asf, vqa, vob, avi, y4m, au, mov, ts, mp3, mpg, wav, ra, mve CVS patchset: 6686 CVS date: 2004/06/13 21:28:52
Diffstat (limited to 'src/demuxers/demux_voc.c')
-rw-r--r--src/demuxers/demux_voc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c
index fe234176f..441d8acaa 100644
--- a/src/demuxers/demux_voc.c
+++ b/src/demuxers/demux_voc.c
@@ -25,7 +25,7 @@
* It will only play that block if it is PCM data. More variations will be
* supported as they are encountered.
*
- * $Id: demux_voc.c,v 1.38 2004/01/09 01:26:33 miguelfreitas Exp $
+ * $Id: demux_voc.c,v 1.39 2004/06/13 21:28:54 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -152,7 +152,7 @@ static int demux_voc_send_chunk(demux_plugin_t *this_gen) {
current_pts /= this->audio_sample_rate;
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;
}
@@ -165,8 +165,8 @@ static int demux_voc_send_chunk(demux_plugin_t *this_gen) {
buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
buf->type = this->audio_type;
- 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;
@@ -231,6 +231,9 @@ static void demux_voc_send_headers(demux_plugin_t *this_gen) {
static int demux_voc_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) {
demux_voc_t *this = (demux_voc_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);