summaryrefslogtreecommitdiffstats
path: root/demux_avi.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-12 20:52:35 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-12 20:52:35 +0000
commitf416b9fc3bbc985e0ae734cd7960e8766c5fa2e4 (patch)
treeef0b5293ec8ca70b3157f91ec6ae7ec9c1c69047 /demux_avi.c
parent255aedeb1a1a815990607cbd30695f9295d623af (diff)
downloadmpv-f416b9fc3bbc985e0ae734cd7960e8766c5fa2e4.tar.bz2
mpv-f416b9fc3bbc985e0ae734cd7960e8766c5fa2e4.tar.xz
PTS calc updates, fixes, cleanups, mess...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1499 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'demux_avi.c')
-rw-r--r--demux_avi.c15
1 files changed, 11 insertions, 4 deletions
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_pos<video_chunk_pos)?audio_chunk_pos:video_chunk_pos;
}
+
+ d_video->pts=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,