Page 1 of 1
libvlc_video_set_track
Posted: 27 Sep 2011 02:35
by Hildor
I used
tutuorial and video starts playing, but
libvlc_video_set_track function does not work or I misunderstand something.
Code: Select all
libvlc_video_get_track_count(mp); // returns 2
libvlc_video_get_track(mp); // returns 1
libvlc_video_set_track(mp, 1); // returns -1 // libvlc_video_set_track(mp, 2) - does the same error meessage
libvlc_errmsg(); // returns "Video track number out of Range"
Can someone explain why track changing failed.
Re: libvlc_video_set_track
Posted: 27 Sep 2011 14:43
by mangokm40
Maybe the 2 tracks are track 0 and track 1. You can try libvlc_video_set_track(mp, 0);
Re: libvlc_video_set_track
Posted: 27 Sep 2011 15:32
by Hildor
Yes libvlc_video_set_track(mp, 0) returns 0, but it doesn't change the track.
Video file has two traks prooved by libvlc_video_get_track_count, if we assume that track numbers starting from 0 or 1(no matter), than libvlc_video_set_track(mp, 1) must succeed.
P.S. Oh and sorry for my bad english.
Re: libvlc_video_set_track
Posted: 27 Sep 2011 16:07
by mangokm40
So you tried this sequence, with these results?
libvlc_video_get_track_count(mp); // returns 2
libvlc_video_get_track(mp); // returns 1
libvlc_video_set_track(mp, 0); // returns 0
libvlc_video_set_track(mp, 1); // returns -1
Re: libvlc_video_set_track
Posted: 27 Sep 2011 18:25
by Hildor
Yes
Re: libvlc_video_set_track
Posted: 02 Oct 2011 10:12
by XilasZ
That's because libvlc_video_set_track wants the track ID, not its index.
You can get it using libvlc_video_get_track_description.
All other get/set track functions use the index, including libvlc_video_get_track.
PS: i know it's weird, nobody took the time to fix it (me included). Maybe i'll fix it someday