[Mplayer-cvslog] CVS: main demuxer.c,1.23,1.24 demux_avi.c,1.23,1.24 demuxer.h,1.13,1.14

Arpi of Ize arpi at mplayer.dev.hu
Wed Aug 22 18:42:39 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv12103

Modified Files:
	demuxer.c demux_avi.c demuxer.h 
Log Message:
added demuxer->seekable flag to generalize seeking ability test

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- demuxer.c	18 Aug 2001 20:32:09 -0000	1.23
+++ demuxer.c	22 Aug 2001 16:42:37 -0000	1.24
@@ -51,6 +51,7 @@
   d->stream=stream;
   d->movi_start=stream->start_pos;
   d->movi_end=stream->end_pos;
+  d->seekable=1;
   d->synced=0;
   d->filepos=0;
   d->audio=new_demuxer_stream(d,a_id);
@@ -413,7 +414,7 @@
   break;
  }
  case DEMUXER_TYPE_AVI: {
-  return demux_open_avi(demuxer);
+  return (demuxer_t*) demux_open_avi(demuxer);
 //  break;
  }
  case DEMUXER_TYPE_ASF: {
@@ -492,10 +493,13 @@
     sh_audio_t *sh_audio=d_audio->sh;
     sh_video_t *sh_video=d_video->sh;
 
-//if(demuxer->file_format==DEMUXER_TYPE_AVI && demuxer->idx_size<=0){
-//    printf("Can't seek in raw .AVI streams! (index required, try with the -idx switch!)  \n");
-//    return 0;
-//}
+if(!demuxer->seekable){
+    if(demuxer->file_format==DEMUXER_TYPE_AVI)
+	mp_msg(MSGT_SEEK,MSGL_WARN,"Can't seek in raw .AVI streams! (index required, try with the -idx switch!)  \n");
+    else
+	mp_msg(MSGT_SEEK,MSGL_WARN,"Can't seek in this file!  \n");
+    return 0;
+}
 
     // clear demux buffers:
     if(sh_audio){ ds_free_packs(d_audio);sh_audio->a_buffer_len=0;}

Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_avi.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- demux_avi.c	17 Aug 2001 00:40:25 -0000	1.23
+++ demux_avi.c	22 Aug 2001 16:42:37 -0000	1.24
@@ -433,6 +433,7 @@
 	  priv->idx_pos_v=demuxer->movi_start;
 	  pts_from_bps=1; // force BPS sync!
       }
+      demuxer->seekable=0;
   }
   if(!ds_fill_buffer(d_video)){
     mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI: missing video stream!? contact the author, it may be a bug :(\n");

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- demuxer.h	12 Aug 2001 15:46:09 -0000	1.13
+++ demuxer.h	22 Aug 2001 16:42:37 -0000	1.14
@@ -62,6 +62,7 @@
   int file_format;  // file format: mpeg/avi/asf
   off_t movi_start;
   off_t movi_end;
+  int seekable;  // flag
   //
   demux_stream_t *audio; // audio buffer/demuxer
   demux_stream_t *video; // video buffer/demuxer




More information about the MPlayer-cvslog mailing list