anchor.diff:  	   (optimize (speed 0)))
   
     (with-accessors ((totalsamples streaminfo-totalsamples)) streaminfo
  -    (if (and streaminfo
  -             (> sample totalsamples)
  -             (/= totalsamples 0))
  -        (error 'flac-error
  -               :format-control
  -               "Seek error. Desired sample number is bigger than number of samples in stream")))
  +    (when (and streaminfo
  +               (> sample totalsamples)
  +               (/= totalsamples 0))
  +      (error 'flac-error
  +             :format-control
  +             "Seek error. Desired sample number is bigger than number of samples in stream")))
   
     ;; Reset the reader
     (reader-position bitreader 0)
  
positive.code: (defmethod read-subframe-body (bit-reader (subframe subframe-verbatim) frame)
    (declare (ignore frame))
    (let ((bps (subframe-actual-bps subframe)))
  
      (with-slots (out-buf) subframe
  		(setf out-buf
  		      (read-bits-array bit-reader out-buf bps :signed t)))))
  
  (defun read-subframe (stream frame actual-bps)
    (declare (type (integer 4 33) actual-bps))
    (if (/= (read-bit stream) 0) (error 'flac-bad-frame
  				      :format-control "Error reading subframe"))
      (let* ((type-num (read-bits 6 stream))
  	   (subframe
  	    (cond
  	     ((= type-num 0) (make-instance 'subframe-constant))         ; 000000
  	     ((= type-num 1) (make-instance 'subframe-verbatim))         ; 000001
  	     ((and
  	       (>= type-num 8)
  	       (<= type-num 12))
  	      (make-instance 'subframe-fixed :order (logand type-num #b111)))     ; 001000-001100
  	     ((and
  	       (>= type-num 32)
  	       (<= type-num 63))
  	      (make-instance 'subframe-lpc :order (1+ (logand type-num #b11111)))) ; 100000-111111
  	     (t (error 'flac-bad-frame
  		       :format-control "Error subframe type"))))
             (wasted-bits
              (let ((lead-in-bit (read-bit stream)))
                (if (= lead-in-bit 1)
                    (1+ (count-zeros stream))
                  0)))
             (blocksize (frame-block-size frame)))
        (declare (type non-negative-fixnum wasted-bits))
  
        (setf (subframe-wasted-bps subframe) wasted-bits            
              (subframe-actual-bps subframe)
              (- actual-bps wasted-bits)
  
              (subframe-out-buf subframe)
              (if (and *out-buffer*
                       (= (length (the (sa-sb 32) *out-buffer*)) blocksize))
                  *out-buffer*
                  (make-array
                   (list blocksize)
                   :element-type '(sb 32))))
  
        (read-subframe-body stream subframe frame)
        subframe))
  
  (defmethod read-frame :around (stream &optional streaminfo)
    (restart-case
  
negative.code:   (let ((frame (make-instance 'frame)))
      #+easy-audio-check-crc
      (init-crc stream)
      (when (/= +frame-sync-code+ (read-bits 14 stream))
        (error 'flac-bad-frame
               :format-control "Frame sync code is not 11111111111110"))
      (unless (zerop (read-bit stream))
        (error 'flac-bad-frame
  	     :format-control "Error reading frame"))
  
      (with-slots (blocking-strategy
                   block-size
                   sample-rate
                   channel-assignment
                   sample-size
                   number)
          frame
        (setf blocking-strategy (get-blocking-strategy (read-bit stream))
              block-size (read-bits 4 stream)
              sample-rate (read-bits 4 stream)
              channel-assignment (get-channel-assignment (read-bits 4 stream))
              sample-size (get-sample-size (read-bits 3 stream) streaminfo))
        
        (unless (zerop (read-bit stream))
          (error 'flac-bad-frame
                 :format-control "Error reading frame"))
  
        (unless (eq blocking-strategy :fixed)
          (error 'flac-bad-frame
                 :format-control "Variable block size not implemented yet"))
        (setf number (read-utf8-u32 stream)
              block-size (get-block-size block-size stream)
              sample-rate (get-sample-rate sample-rate stream streaminfo)
              (frame-crc-8 frame) (read-octet stream)))
  