[Mplayer-cvslog] CVS: main demux_avi.c,1.9,1.10 demuxer.c,1.13,1.14 mplayer.c,1.195,1.196 seek.c,1.3,1.4
Arpi of Ize
arpi at mplayer.dev.hu
Sun Jul 29 23:07:36 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv10138
Modified Files:
demux_avi.c demuxer.c mplayer.c seek.c
Log Message:
nosound avi seeking fixed
Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_avi.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- demux_avi.c 29 Jul 2001 01:28:07 -0000 1.9
+++ demux_avi.c 29 Jul 2001 21:07:34 -0000 1.10
@@ -126,12 +126,14 @@
do{
int flags=0;
AVIINDEXENTRY *idx=NULL;
+#if 0
demux->filepos=stream_tell(demux->stream);
if(demux->filepos>=demux->movi_end){
demux->stream->eof=1;
return 0;
}
if(stream_eof(demux->stream)) return 0;
+#endif
if(demux->idx_size>0 && demux->idx_pos<demux->idx_size){
unsigned int pos;
@@ -155,7 +157,7 @@
pos=idx->dwChunkOffset+demux->idx_offset;
if(pos<demux->movi_start || pos>=demux->movi_end){
- printf("ChunkOffset out of range! current=0x%X idx=0x%X \n",demux->filepos,pos);
+ printf("ChunkOffset out of range! idx=0x%X \n",pos);
continue;
}
#if 0
@@ -164,7 +166,10 @@
}
#endif
stream_seek(demux->stream,pos);
+ demux->filepos=stream_tell(demux->stream);
id=stream_read_dword_le(demux->stream);
+ if(stream_eof(demux->stream)) return 0; // EOF!
+
if(id!=idx->ckid){
printf("ChunkID mismatch! raw=%.4s idx=%.4s \n",(char *)&id,(char *)&idx->ckid);
continue;
@@ -178,8 +183,15 @@
}
if(idx->dwFlags&AVIIF_KEYFRAME) flags=1;
} else {
+ demux->filepos=stream_tell(demux->stream);
+ if(demux->filepos>=demux->movi_end){
+ demux->stream->eof=1;
+ return 0;
+ }
id=stream_read_dword_le(demux->stream);
len=stream_read_dword_le(demux->stream);
+ if(stream_eof(demux->stream)) return 0; // EOF!
+
if(id==mmioFOURCC('L','I','S','T')){
id=stream_read_dword_le(demux->stream); // list type
continue;
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- demuxer.c 28 Jul 2001 21:18:21 -0000 1.13
+++ demuxer.c 29 Jul 2001 21:07:34 -0000 1.14
@@ -180,7 +180,10 @@
printf("(maybe you play a non-interleaved stream/file or video codec failed)\n");
break;
}
- if(!demux_fill_buffer(demux,ds)) break; // EOF
+ if(!demux_fill_buffer(demux,ds)){
+ if(verbose) printf("ds_fill_buffer()->demux_fill_buffer() failed\n");
+ break; // EOF
+ }
}
ds->buffer_pos=ds->buffer_size=0;
ds->buffer=NULL;
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -r1.195 -r1.196
--- mplayer.c 29 Jul 2001 17:42:06 -0000 1.195
+++ mplayer.c 29 Jul 2001 21:07:34 -0000 1.196
@@ -1166,16 +1166,16 @@
videobuffer[videobuf_len+3]=0xFF;
videobuf_len+=4;
#endif
- if(!i) eof=1; // EOF
+ if(!i) eof=2; // EOF
break;
}
} else {
//if(i==0x100) in_frame=1; // picture startcode
if(i>=0x101 && i<0x1B0) in_frame=1; // picture startcode
- else if(!i){ eof=1; break;} // EOF
+ else if(!i){ eof=3; break;} // EOF
}
if(grab_frames==2 && (i==0x1B3 || i==0x1B8)) grab_frames=1;
- if(!read_video_packet(d_video)){ eof=1; break;} // EOF
+ if(!read_video_packet(d_video)){ eof=4; break;} // EOF
//printf("read packet 0x%X, len=%d\n",i,videobuf_len);
if(sh_video->codec->driver!=VFM_MPEG){
// if not libmpeg2:
@@ -1212,7 +1212,7 @@
// frame-based file formats: (AVI,ASF,MOV)
unsigned char* start=NULL;
int in_size=ds_get_packet(d_video,&start);
- if(in_size<0){ eof=1;break;}
+ if(in_size<0){ eof=5;break;}
if(in_size>max_framesize) max_framesize=in_size;
blit_frame=decode_video(video_out,sh_video,start,in_size,drop_frame);
}
@@ -1545,7 +1545,7 @@
rel_seek_secs=0;
//================= Update OSD ====================
-{ if(osd_level>=2){
+ if(osd_level>=2){
int pts=d_video->pts;
if(pts==osd_last_pts-1) ++pts; else osd_last_pts=pts;
vo_osd_text=osd_text_buffer;
@@ -1581,9 +1581,9 @@
}
}
-}
-
} // while(!eof)
+
+if(verbose) printf("EOF code: %d \n",eof);
exit_player("End of file");
}
Index: seek.c
===================================================================
RCS file: /cvsroot/mplayer/main/seek.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- seek.c 29 Jul 2001 00:39:47 -0000 1.3
+++ seek.c 29 Jul 2001 21:07:34 -0000 1.4
@@ -51,6 +51,8 @@
if(sh_audio){ ds_free_packs(d_audio);sh_audio->a_buffer_len=0;}
ds_free_packs(d_video);
+ demuxer->stream->eof=0; // clear eof flag
+
// printf("sh_audio->a_buffer_len=%d \n",sh_audio->a_buffer_len);
More information about the MPlayer-cvslog
mailing list