Finalized Bindings [Addendum]

After fiddling with some other code, i realized that I could condense my real code a bit. My finalizers where basically (lambda (value) (finalizer-function value)) where I should just actually pass in finalizer-function

    (define/public (play file-index callback)
      (let ((file (schemep3-database-index->filename file-index)))
        (if (not (file-exists? file))
            (values #f #f)
             (lambda () (call-vlc libvlc_media_new (get-vlc-instance) (path->mrl file)))
             (lambda (media)
                (lambda () (call-vlc libvlc_media_player_new_from_media media))
                (lambda (media-player)
                  (call-vlc libvlc_media_player_play media-player)
                  (internal-playback-loop media-player callback))

Leave a Reply

Your email address will not be published. Required fields are marked *