From f416b9fc3bbc985e0ae734cd7960e8766c5fa2e4 Mon Sep 17 00:00:00 2001 From: arpi Date: Sun, 12 Aug 2001 20:52:35 +0000 Subject: PTS calc updates, fixes, cleanups, mess... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1499 b3059339-0415-0410-9bf9-f77b7e298cf2 --- demux_avi.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'demux_avi.c') diff --git a/demux_avi.c b/demux_avi.c index 8b7df0bb84..9ddee43ba3 100644 --- a/demux_avi.c +++ b/demux_avi.c @@ -54,7 +54,6 @@ demux_stream_t* demux_avi_select_stream(demuxer_t *demux,unsigned int id){ return NULL; } - static int demux_avi_read_packet(demuxer_t *demux,unsigned int id,unsigned int len,int idxpos,int flags){ avi_priv_t *priv=demux->priv; int skip; @@ -87,8 +86,8 @@ static int demux_avi_read_packet(demuxer_t *demux,unsigned int id,unsigned int l // drop frame (seeking) --priv->skip_video_frames; ds=NULL; - } else { - pts=priv->avi_video_pts; +// } else { +// pts=priv->avi_video_pts; } // ezt a 2 sort lehet hogy fell kell majd cserelni: //priv->avi_video_pts+=avi_pts_frametime; @@ -110,6 +109,10 @@ static int demux_avi_read_packet(demuxer_t *demux,unsigned int id,unsigned int l priv->avi_audio_pts=priv->avi_video_pts+priv->pts_correction; priv->pts_has_video=1; + pts=priv->avi_video_pts; + + //printf("read pack_no: %d pts %5.3f \n",demux->video->pack_no+demux->video->packs,pts); + } // len=stream_read_dword_le(demux->stream); @@ -500,7 +503,7 @@ void demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags){ } } else { // seek backward - while(video_chunk_pos>=0){ + while(video_chunk_pos>0){ int id=((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].ckid; if(avi_stream_id(id)==d_video->id){ // video frame if((++rel_seek_frames)>0 && ((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].dwFlags&AVIIF_KEYFRAME) break; @@ -519,6 +522,8 @@ void demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags){ sh_video->num_frames=d_video->pack_no; priv->avi_video_pts=d_video->pack_no*(float)sh_video->video.dwScale/(float)sh_video->video.dwRate; d_video->pos=video_chunk_pos; + + printf("V_SEEK: pack=%d pts=%5.3f chunk=%d \n",d_video->pack_no,priv->avi_video_pts,video_chunk_pos); // ------------ STEP 2: seek audio, find the right chunk & pos ------------ @@ -622,6 +627,8 @@ void demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags){ priv->idx_pos_v=video_chunk_pos; priv->idx_pos=(audio_chunk_pospts=priv->avi_video_pts; // OSD if(verbose) printf("SEEK: idx=%d (a:%d v:%d) v.skip=%d a.skip=%d/%4.3f \n", priv->idx_pos,audio_chunk_pos,video_chunk_pos, -- cgit v1.2.3