anchor.diff:     (avi :accessor avi :initarg :avi)))
   
   (defclass mjpeg-stream-record (stream-record)
  -  ((jpeg-descriptor :accessor jpeg-descriptor :initform (cl-jpeg::make-descriptor))))
  +  ((buffer :accessor buffer :type '(unsigned-byte 8))
  +   (jpeg-descriptor :accessor jpeg-descriptor :initform (cl-jpeg::make-descriptor))))
   
   (defmethod shared-initialize :after ((rec mjpeg-stream-record) slots &key &allow-other-keys)
     (declare (ignorable slots))
     (flexi-streams:with-input-from-sequence (is +avi-dht+)
       (jpeg::read-dht (jpeg-descriptor rec) is))
  -  (setf (chunk-queue rec) (make-list (* 2 (floor (rate rec) (scale rec)))))
  +  (setf (buffer rec) (make-array (suggested-buffer-size rec) :element-type '(unsigned-byte 8))
  +	(chunk-queue rec) (make-list (* 2 (floor (rate rec) (scale rec)))))
     (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)
  
positive.code:    (padding :accessor padding :initform 0)
     (flags :accessor flags)
     (nstreams :accessor nstreams)
     (player-callback :accessor player-callback :initform nil) ;;called once all headers are processed
     (stream-records :accessor stream-records)))
  
  (defgeneric decode-media-stream (record fsize input-stream))
  
negative.code: 
  (defmethod decode-media-stream ((rec mjpeg-stream-record) fsize input-stream)
    (bt:with-lock-held ((vacancy-lock (car (wcursor rec))))
      (read-sequence (buffer rec) input-stream :end fsize)
      (flexi-streams:with-input-from-sequence (is (buffer rec))
        (jpeg:decode-stream is :buffer (frame (car (wcursor rec)))
  			  :descriptor (jpeg-descriptor rec)))
      (pop (wcursor rec))))
  
  (defmethod initialize-instance :after ((s avi-mjpeg-stream) &key &allow-other-keys)
  