anchor.diff:    (find-if #'(lambda (x) (and (eql (type-of x) 'audio-stream-record)
   			      (eql (compression-code x) +pcmi-uncompressed+))) (stream-records avi)))
   
  +(defmethod prime-all-streams ((avi avi-mjpeg-stream))
  +  ;; the playback shouldn't start before 1st frame is decoded
  +  (loop for rec in (stream-records avi) do
  +       (bt:acquire-lock (vacancy-lock (car (wcursor rec))))))
  +
  +
   (defmethod decode ((avi avi-mjpeg-stream))
     (with-open-file (stream (filename avi) :direction :input :element-type '(unsigned-byte 8))
       ;; read AVI header first
  
positive.code:    (buffer :accessor buffer :type '(unsigned-byte 8))
     (avi :accessor avi :initarg :avi)))
  
  (defmethod stream-playback-start ((rec stream-record))
    (bt:acquire-lock (vacancy-lock (car (rcursor rec)))))
  
  
negative.code:     (setf (jpeg::descriptor-byte-reader (jpeg-descriptor rec)) #'(lambda () (read-byte is)))
      (jpeg:read-dht (jpeg-descriptor rec)))
    (setf (buffer rec) (make-array (suggested-buffer-size rec) :element-type '(unsigned-byte 8))
  	(jpeg:descriptor-source-cache (jpeg-descriptor rec)) (buffer rec))
    (initialize-ring rec (max 5 (* 1 (floor (rate rec) (scale rec)))) ;at least 5 chunks to prevent cursor deadlocks
  		   (* (height (avi rec)) (width (avi rec)) 3) 'cl-jpeg::uint8))
  
  (defclass audio-stream-record (stream-record)
    ((compression-code :accessor compression-code)
  