Commits

Anonymous committed e2cfc30

Made modifications for backward compat with older ffmpeg libraries. As
well, fixed bug in examples script. Did not see any crashes on the
laptop, will test on the desktop.

  • Participants
  • Parent commits a64b5b9

Comments (0)

Files changed (4)

File examples/__movie_test.py

 import sys
 #sys.exit()
 print "Surface time..."
+m.stop()
+time.sleep(5)
 
+del m
 
-screen = pygame.display.set_mode((800, 340))
+screen = pygame.display.set_mode((info.width, info.height))
 ##m.surface=screen
 ##time.sleep(1)
 ###This will move the movie player from overlay mode to blitting to the surface 

File src/_gmovie.c

         ret = -1;
         goto fail;
     }
+#if LIBAVCODEC_VERSION_INT>=3412992 //(52<<16)+(20<<8)+0 ie 52.20.0
     if(ic->pb)
         ic->pb->eof_reached= 0; //FIXME hack, ffplay maybe should not use url_feof() to test for the end
-
+#endif
 
     movie->ic = ic;
     ret=0;
     /* prepare audio output */
     if (enc->codec_type == CODEC_TYPE_AUDIO)
     {
+#if LIBAVCODEC_VERSION_INT>=3412992 //(52<<16)+(20<<8)+0 ie 52.20.0
         if (enc->channels > 0)
         {
             enc->request_channels = FFMIN(2, enc->channels);
         {
             enc->request_channels = 2;
         }
+#endif
     }
     codec = avcodec_find_decoder(enc->codec_id);
     enc->debug_mv = 0;
             }
             continue;
         }
-
+#if LIBAVCODEC_VERSION_INT>=3412992 //(52<<16)+(20<<8)+0 ie 52.20.0
         if(url_feof(ic->pb))
         {
             av_init_packet(pkt);
             packet_queue_put(&movie->videoq, pkt);
             continue;
         }
+#endif
         if(movie->pictq_size<VIDEO_PICTURE_QUEUE_SIZE)
         {
             ret = av_read_frame(ic, pkt);

File src/_gmovie.h

 #define _GMOVIE_H_
 
 /* local includes */
-#include "docs/_movie_doc.h"
+#include "doc/_movie_doc.h"
 #include "pygame.h"
 #include "pgcompat.h"
 #include "surface.h"

File src/gmovie.c

 void _info_init_internal(PyMovieInfo *self, const char *filename)
 {
 	/* filename checking... */
+    self->vid_codec = "";
+    self->aud_codec = "";
+    
     PyObject *path = PyImport_ImportModule("os.path");
     Py_INCREF(path);
     PyObject *dict = PyModule_GetDict(path);