diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-06-13 21:28:52 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-06-13 21:28:52 +0000 |
commit | f85a943fdff3f12db8faf4b84e4f63aafdc60db3 (patch) | |
tree | e16cc52e6b9a9548714a1ee31a5265ff34127467 /src/demuxers/demux_str.c | |
parent | 62f8ce9ec67fb85da1023b5db90a0a5f1609cff7 (diff) | |
download | xine-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_str.c')
-rw-r--r-- | src/demuxers/demux_str.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index 821e738d4..ddb800260 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -24,7 +24,7 @@ * This demuxer handles either raw STR files (which are just a concatenation * of raw compact disc sectors) or STR files with RIFF headers. * - * $Id: demux_str.c,v 1.24 2004/02/09 22:24:37 jstembridge Exp $ + * $Id: demux_str.c,v 1.25 2004/06/13 21:28:54 miguelfreitas Exp $ */ /* @@ -359,7 +359,7 @@ static int demux_str_send_chunk(demux_plugin_t *this_gen) { buf->pts = frame_number * FRAME_DURATION; if (this->seek_flag) { - _x_demux_control_newpts(this->stream, buf->pts, 0); + _x_demux_control_newpts(this->stream, buf->pts, BUF_FLAG_SEEK); this->seek_flag = 0; } @@ -371,8 +371,9 @@ static int demux_str_send_chunk(demux_plugin_t *this_gen) { *} */ - buf->extra_info->input_pos = current_pos; - buf->extra_info->input_length = this->data_size; + if( this->data_size ) + buf->extra_info->input_normpos = (int)( (double) current_pos * + 65535 / this->data_size ); buf->extra_info->input_time = (current_pos*1000)/(CD_RAW_SECTOR_SIZE*75); /* constant size chunk */ @@ -404,12 +405,13 @@ static int demux_str_send_chunk(demux_plugin_t *this_gen) { ((sector[0x13] & 0x04) ? 18900 : 37800); if (this->seek_flag) { - _x_demux_control_newpts(this->stream, buf->pts, 0); + _x_demux_control_newpts(this->stream, buf->pts, BUF_FLAG_SEEK); this->seek_flag = 0; } - buf->extra_info->input_pos = current_pos; - buf->extra_info->input_length = this->data_size; + if( this->data_size ) + buf->extra_info->input_normpos = (int)( (double) current_pos * + 65535 / this->data_size ); buf->extra_info->input_time = (current_pos*1000)/(CD_RAW_SECTOR_SIZE*75); buf->size = 2304; @@ -498,6 +500,8 @@ static void demux_str_send_headers(demux_plugin_t *this_gen) { static int demux_str_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) { demux_str_t *this = (demux_str_t *) this_gen; + start_pos = (off_t) ( (double) start_pos / 65535 * + this->data_size ); _x_demux_flush_engine (this->stream); |