SPU track ids

This forum is about all development around libVLC.
sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

SPU track ids

Postby sherington » 19 Feb 2013 22:09

Hello,

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)
With this fix the audio track ids that come back through the libvlc track description API are now consistent with what is used for the libvlc get/set audio track API and this works great.

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15143
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: SPU track ids

Postby Rémi Denis-Courmont » 19 Feb 2013 22:45

Changing the signedness is not nice but unavoidable. It should be OK since C requires identical representation for positive values of corresponding signed and unsigned types.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: SPU track ids

Postby sherington » 20 Feb 2013 17:34

This works just fine now, thanks for your fix.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 1 guest