Commits

zeroth  committed 48a2aa6

Added video display destruction on a stop. However, replaying causes a
weird issue with corrupted data. Must examine why.

  • Participants
  • Parent commits 176b671
  • Branches tylerthemovie

Comments (0)

Files changed (4)

File movie_test.py

 
 print "Please give an (absolute)filename of a movie file you'd like to play: ",
 #filename = raw_input()
-filename="/home/tyler/video.flv"
+filename="/home/tyler/War3.avi"
 #initialization. It could also have a surface as a second argument, and every 
 # frame will be blitted to that surface. It is the programmer's responsibility
 # to be on time for rendering that surface.
 print m         #calls __repr__, which will show the filename, and the current 
                 # timestamp. 
 #print "repeated looping plays.."#
-m.play(9)
-time.sleep(9*130)
+#m.play(9)
+#time.sleep(9*130)
 
 
 print "Playing infinitely"

File src/_gmovie.c

         }
         //check if the movie has ended
         
-        if(getBufferQueueSize()>10)
+        if(getBufferQueueSize()>20)
         {
         	SDL_Delay(100);
         	continue;
 void stream_close(PyMovie *movie, int threaded)
 {
     DECLAREGIL
-    GRABGIL
+    if(threaded)GRABGIL
     if(movie->ob_refcnt!=0)
         Py_INCREF(movie);
-    RELEASEGIL
+    if(threaded)RELEASEGIL
     movie->abort_request = 1;
     SDL_WaitThread(movie->parse_tid, NULL);
     VidPicture *vp;
 
     if(movie->ob_refcnt!=0)
     {
-        GRABGIL
+        if(threaded)GRABGIL
         Py_DECREF(movie);
-        RELEASEGIL
+        if(threaded)RELEASEGIL
     }
 }
 
 	                vp->dest_surface=NULL;
 	            }
 	            
-	        }	
+	        }
+	        if (SDL_WasInit (SDL_INIT_VIDEO))
+        		SDL_QuitSubSystem (SDL_INIT_VIDEO);	
     	}
     }
     GRABGIL

File src/_gsound.c

     ainfo->ended = 1;
     ainfo->restart=1;
     queue_flush(&ainfo->queue);
+    ainfo->queue.size=0;
     return 0;
 }
 
 
 int stopBuffer (int channel)
 {
-    if(!channel)
-        return 0;
+	queue_flush(&ainfo->queue);
     return 0;
 }
 

File src/gmovie.c

 
 PyObject* _movie_stop(PyMovie *movie)
 {
-    stream_pause(movie);
+    //stream_pause(movie);
     ALLOC_COMMAND(stopCommand, stop);
     addCommand(movie->commands, (Command *)stop);
     Py_RETURN_NONE;