I have been looking at track ids, track descriptions and the various get/set methods for audio/video and spu tracks.
I spotted this fix from last year:
Code: Select all
commit 2c5ee1707b1962ee3f47dbe4abb7c199aeccc022
Author: Rémi Denis-Courmont <remi@remlab.net>
Date: Thu Nov 8 22:39:35 2012 +0200
lib: correct and uniformize audio/video track IDs (fixes #7645)
I think a similar problem exists with spu tracks - i.e. the ids that come back with spu descriptions can not be used with libvlc_video_set_spu. In particular, the API currently specifies an unsigned int parameter for the spu track making it tricky to use the track id "-1" to selected the disabled spu track (you must pass 0 instead for the first track).
I have an experimental patch that makes spu track id handling consistent with audio/video track id handling - I basically copied exactly from the commit referenced above and it seems to work. One issue with my patch is that it changes the published API signature for libvlc_video_set_spu(unsigned) to libvlc_video_set_spu(int). Is that going to be a problem? Is there a better way to proceed? Or is the current behaviour of the API in fact correct?