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_mpgaudio.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_mpgaudio.c')
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index ecf08f193..87f5f6aa4 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.137 2004/05/05 22:37:46 tmattern Exp $ + * $Id: demux_mpgaudio.c,v 1.138 2004/06/13 21:28:54 miguelfreitas Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -424,7 +424,9 @@ static int mpg123_parse_frame_payload(demux_mpgaudio_t *this, pts = (int64_t)this->cur_fpts; check_newpts(this, pts); - buf->extra_info->input_pos = frame_pos; + if( this->input->get_length (this->input) ) + buf->extra_info->input_normpos = (int)( (double) frame_pos * + 65535 / this->input->get_length (this->input) ); buf->extra_info->input_time = pts / 90; buf->pts = pts; buf->size = len + 4; @@ -750,6 +752,8 @@ static int demux_mpgaudio_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) { demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen; + start_pos = (off_t) ( (double) start_pos / 65535 * + this->input->get_length (this->input) ); if ((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) != 0) { if (!start_pos && start_time && this->stream_length > 0) { |