anchor.diff:      (loop for chunk = (riff:read-riff-chunk stream :chunk-data-reader (chunk-decoder avi))
   	 while chunk)))
   
  -(defun decode-file (pathname)
  -  (let ((avi-stream (make-instance 'avi-mjpeg-stream :filename pathname)))
  +(defun decode-file (pathname &key player-callback)
  +  (let ((avi-stream (make-instance 'avi-mjpeg-stream :filename pathname :player-callback player-callback)))
       (decode avi-stream)))
   
   (defun show-file-chunks (pathname)
  
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)
  