anchor.diff:    (loop for chunk on (chunk-queue s) do
          (setf (car chunk) (make-instance 'chunk :frame (make-array (* (width s) (height s)) :element-type '(unsigned-byte 8)))))
     (setf (chunk-decoder s) #'(lambda (stream id size)
  -			      (declare (ignorable id))
  -			      (when (> size (length (frame (wcursor s))))
  -				(setf (frame (wcursor s)) (make-array size :element-type '(unsigned-byte 8))))
  -			      (cond ((string= (subseq id 2) "dc")
  -				     (setf (stream-number (frame (wcursor s))) (parse-integer (subseq id 0 1)))
  -				     (jpeg:decode-stream stream :buffer (frame (wcursor s))
  -							 :descriptor (jpeg-descriptor s))
  +			      (print id)
  +			      (cond ((string-equal (subseq id 2) "dc")
  +				     (bt:with-lock-held ((vacancy-lock (car (wcursor s))))
  +				       (setf (stream-number (car (wcursor s))) (parse-integer (subseq id 0 1)))
  +				       (jpeg:decode-stream stream :buffer (frame (car (wcursor s)))
  +							   :descriptor (jpeg-descriptor s))
  +				       (pop (wcursor s)))
   				     ;; take care of the padding
  -				     (loop repeat (rem size (padding s)) do (read-byte s)))
  +				       (loop repeat (padding s) do (read-byte s)))
   				    (t (read-sequence (make-array size :element-type '(unsigned-byte 8)) stream))))
   	(cdr (last (chunk-queue s))) (chunk-queue s)
   	(rcursor s) (chunk-queue s)
  
positive.code:    (height :accessor height :initarg :height :initform 480)
     (jpeg-descriptor :accessor jpeg-descriptor :initform (cl-jpeg::make-descriptor))
     (padding :accessor padding :initform 1)
     (fps :accessor fps :initarg :fps :initform +default-fps+)))
  
  (defmethod initialize-instance :after ((s avi-mjpeg-stream) &key)
  
negative.code: 	     (declare (ignorable condition))
  	     (format stream "Unrecognized AVI file format"))))
  
  (define-condition unsupported-avi-file-format (media-decoder-error)
    ()
    (:report (lambda (condition stream)
  	     (declare (ignorable condition))
  	     (format stream "Unsupported AVI file format"))))
  
  (defclass chunk ()
    ((lock :reader vacancy-lock :initform (bt:make-lock))
     (stream-number :accessor stream-number)
     (frame :accessor frame :initarg :frame)))
  
  (defclass video-stream ()
  