[Mplayer-cvslog] CVS: main find_sub.c,1.4,1.5 mplayer.c,1.339,1.340 subreader.c,1.40,1.41 subreader.h,1.9,1.10

Zoltan Ponekker pontscho at mplayer.dev.hu
Mon Dec 17 01:07:23 CET 2001


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

Modified Files:
	find_sub.c mplayer.c subreader.c subreader.h 
Log Message:
some small sub bug fix

Index: find_sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/find_sub.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- find_sub.c	14 Nov 2001 11:16:45 -0000	1.4
+++ find_sub.c	17 Dec 2001 00:07:20 -0000	1.5
@@ -25,6 +25,9 @@
 
 void find_sub(subtitle* subtitles,int key){
     int i,j;
+    
+    if ( !subtitles ) return;
+    
     if(vo_sub){
       if(key>=vo_sub->start && key<=vo_sub->end) return; // OK!
     } else {

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.339
retrieving revision 1.340
diff -u -r1.339 -r1.340
--- mplayer.c	16 Dec 2001 23:59:13 -0000	1.339
+++ mplayer.c	17 Dec 2001 00:07:20 -0000	1.340
@@ -663,13 +663,17 @@
 	usleep(20000);
 	EventHandling();
       }
-      if(mplShMem->FilenameChanged){
-        filename=mplShMem->Filename;
-      }
+      
 #ifdef USE_SUB
-      sub_name=NULL;
-      if ( mplShMem->SubtitleChanged ) sub_name=mplShMem->Subtitlename;
+      if ( mplShMem->SubtitleChanged || !mplShMem->FilenameChanged )
+       { sub_name=mplShMem->Subtitlename; mplShMem->SubtitleChanged=0; }
 #endif
+
+      if ( mplShMem->FilenameChanged || !filename )
+       {
+        filename=mplShMem->Filename;
+	mplShMem->FilenameChanged=0;
+       }
     }
 #endif
 
@@ -2178,7 +2182,15 @@
 
   current_module="free_stream";
   if(stream) free_stream(stream);
-
+  
+  current_module="sub_free";
+  if ( subtitles ) 
+   {
+    sub_free( subtitles );
+    sub_name=NULL;
+    vo_sub=NULL;
+   }
+  
   video_out=NULL;
   audio_out=NULL;
 

Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- subreader.c	10 Dec 2001 14:48:02 -0000	1.40
+++ subreader.c	17 Dec 2001 00:07:20 -0000	1.41
@@ -802,7 +802,18 @@
 	printf ("Subtitles dumped in \'dump.mpsub\'.\n");
 }
 
-
+void sub_free( subtitle * subs )
+{
+ int i;
+ 
+ if ( !subs ) return;
+ 
+ sub_num=0;
+ sub_errs=0;
+ for ( i=0;i<subs->lines;i++ ) free( subs->text[i] );
+ free( subs );
+ subs=NULL;
+}
 
 #ifdef DUMPSUBS
 int main(int argc, char **argv) {  // for testing

Index: subreader.h
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- subreader.h	15 Nov 2001 11:53:11 -0000	1.9
+++ subreader.h	17 Dec 2001 00:07:20 -0000	1.10
@@ -37,5 +37,6 @@
 subtitle* sub_read_file (char *filename);
 char * sub_filename(char *path, char * fname );
 void list_sub_file(subtitle* subs);
+void sub_free( subtitle * subs );
 
 #endif




More information about the MPlayer-cvslog mailing list