anchor.diff:      (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)
  -	(chunk-queue rec) (make-list (max 5 (* 1 (floor (rate rec) (scale rec)))))) ;at least 5 chunks to prevent cursor deadlocks
  -  (loop for chunk on (chunk-queue rec) do
  -       (setf (car chunk) (make-instance 'chunk :frame (jpeg:allocate-buffer (height (avi rec)) (width (avi rec)) 3))))
  -  (setf (cdr (last (chunk-queue rec))) (chunk-queue rec)
  -	(rcursor rec) (chunk-queue rec)
  -	(wcursor rec) (cdr (chunk-queue rec))))
  +	(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)
  
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: 	(error 'unrecognized-file-format))
        (cond ((string-equal fourcc "avi ") (read-avi-header avi stream))
  	    (t (error 'unsupported-avi-file-format))))
      (when (player-callback avi)
        (funcall (player-callback avi) avi))
      (loop for chunk = (riff:read-riff-chunk stream :chunk-data-reader (chunk-decoder avi))
  