anchor.diff:  						 :thread (mezzano.supervisor:current-thread)
   						 :font font
   						 :frame frame))
  -			  (rec (cl-video:find-mjpeg-stream-record avi))
  -			  (avi-width (cl-video:width avi))
  -			  (avi-height (cl-video:height avi))
  +			  (rec (cl-video:find-mjpeg-stream-record container))
  +			  (video-width (cl-video:width container))
  +			  (video-height (cl-video:height container))
   			  (quit nil))
   
   		     ;; Handling the window events in own thread
  
positive.code: 	   #'(lambda ()
  	       ;; Window needs to be slightly larger than the video to account for the frame.
  	       (multiple-value-bind (window-width window-height)
  		   (compute-window-size avi)
  		 (mezzano.gui.compositor:with-window (window fifo window-width window-height)
  		   (let* ((framebuffer (mezzano.gui.compositor:window-buffer window))
  			  (frame (make-instance 'mezzano.gui.widgets:frame
  						:framebuffer framebuffer
  						:title (pathname-name (cl-video:filename avi))
  						:close-button-p t
  						:damage-function (mezzano.gui.widgets:default-damage-function window)))
  			  (viewer (make-instance 'media-player
  
negative.code: 				   (ignore-errors
  				     (format t "Error: ~A~%" c)))
  				 (mezzano.gui.widgets:close-button-clicked ()
  				   (setf (cl-video:finish container) t)
  				   (setf quit t))
  				 (pause-event ()
  				   (setf should-pause t)))))
                :name "Trentino event worker")
  		     (cl-video:stream-playback-start rec)
  		     (unwind-protect
  			  (loop until quit
  			     for cur = (if (cl-video:pause container) cur (cl-video:pop-chunk-rcursor rec))
  			     for src = (cl-video:frame cur) do
  			       (multiple-value-bind (left right top bottom)
  				   (mezzano.gui.widgets:frame-size frame)
  				 (declare (ignore right bottom))
  				 (mezzano.gui.image:transcode-cl-jpeg-buffer
  				  framebuffer left top
  				  src video-width video-height 3)
  				 (mezzano.gui.widgets:draw-frame frame)
  				 (mezzano.gui.compositor:damage-window window
  								       0 0
  								       (cl-video:width container) (cl-video:height container)))
  			       (unless (cl-video:pause container)
  				 (mezzano.supervisor:acquire-mutex (cl-video:vacancy-lock (car (cl-video:rcursor rec))))
  				 (mezzano.supervisor:release-mutex (cl-video:vacancy-lock cur)))
  			       (when (eql cur (cl-video:final rec))
  				 (return))
  			       (sleep (cl-video:frame-delay rec))
  			       (when should-pause
  				 (setf (cl-video:pause container) (not (cl-video:pause container)))
  				 (mezzano.supervisor:acquire-mutex (cl-video:pause-lock container))
  				 (mezzano.supervisor:release-mutex (cl-video:pause-lock container))))
  		       (cl-video:stream-playback-stop rec))))))
         :name "Trentino video worker"))))
  
  (defun decode-file (pathname &key player-callback)
    (let ((container (make-instance (cond  ((string-equal "avi" (pathname-type pathname)) 'cl-video:avi-mjpeg-container)
  					 ((string-equal "gif" (pathname-type pathname)) 'cl-video:gif-container)
  					 (t (error 'unrecognized-file-format))) :filename pathname :player-callback player-callback)))
      (cl-video:decode container)))
  
  (defun main (path)
    (decode-file path :player-callback #'(lambda (video)
  						  (let ((a (cl-video:find-pcm-stream-record video)))
  						    (when a (change-class a 'hda-pcm-stream-record)))
  						  (cl-video:prime-all-streams video)
  						  (play-audio-stream video) (play-video-stream video))))
  
  (defun spawn (path)
    (setf path (merge-pathnames path))
  