From f85a943fdff3f12db8faf4b84e4f63aafdc60db3 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sun, 13 Jun 2004 21:28:52 +0000 Subject: 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 --- src/demuxers/demux_mpgaudio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/demuxers/demux_mpgaudio.c') 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) { -- cgit v1.2.3