*** a/pyffmpeg.pyx	2011-01-12 15:49:19.000000000 +0000
--- b/pyffmpeg.pyx	2011-12-15 22:51:17.000000000 +0000
***************
*** 622,628 ****
      AVFormatContext *  avformat_alloc_context()
      AVOutputFormat *guess_format(char *short_name, char *filename,char *mime_type)
  
! cdef __registered
  __registered = 0
  
  
--- 622,628 ----
      AVFormatContext *  avformat_alloc_context()
      AVOutputFormat *guess_format(char *short_name, char *filename,char *mime_type)
  
! cdef int __registered
  __registered = 0
  
  
***************
*** 703,708 ****
--- 703,709 ----
  
  
  def py_av_register_all():
+     global __registered
      if __registered:
          return
      __registered = 1
***************
*** 805,811 ****
   #   self.prepacket=<AVPacket *>None
  #   self.packet=&self.packetbufa
  
!     def __new__(self):
          pass
  
      def dump(self):
--- 806,812 ----
   #   self.prepacket=<AVPacket *>None
  #   self.packet=&self.packetbufa
  
!     def __cinit__(self):
          pass
  
      def dump(self):
***************
*** 857,863 ****
      cdef int do_check_end
      cdef int reopen_codec_on_buffer_reset
  
!     cdef __new__(Track self):
          self.vr=None
          self.observer=None
          self.support_truncated=1
--- 858,864 ----
      cdef int do_check_end
      cdef int reopen_codec_on_buffer_reset
  
!     def __cinit__(Track self):
          self.vr=None
          self.observer=None
          self.support_truncated=1
***************
*** 1092,1098 ****
      cdef uint8_t *audio_pkt_data
      cdef int audio_pkt_size
  
!     cdef __new__(self):
          self.audio_pkt_data =<uint8_t *>NULL
          self.audio_pkt_size=0
  
--- 1093,1099 ----
      cdef uint8_t *audio_pkt_data
      cdef int audio_pkt_size
  
!     def __cinit__(self):
          self.audio_pkt_data =<uint8_t *>NULL
          self.audio_pkt_size=0
  
***************
*** 1832,1838 ****
      cdef int with_readahead
      cdef unsigned long long int seek_before_security_interval
  
!     def __new__(self,with_readahead=True,seek_before=4000):
          self.filename = None
          self.tracks=[]
          self.ctracks=NULL
--- 1833,1839 ----
      cdef int with_readahead
      cdef unsigned long long int seek_before_security_interval
  
!     def __cinit__(self,with_readahead=True,seek_before=4000):
          self.filename = None
          self.tracks=[]
          self.ctracks=NULL
