libvlc_video_set_track

This forum is about all development around libVLC.
Hildor
New Cone
New Cone
Posts: 3
Joined: 27 Sep 2011 02:07

libvlc_video_set_track

Postby Hildor » 27 Sep 2011 02:35

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.

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: libvlc_video_set_track

Postby mangokm40 » 27 Sep 2011 14:43

Maybe the 2 tracks are track 0 and track 1. You can try libvlc_video_set_track(mp, 0);

Hildor
New Cone
New Cone
Posts: 3
Joined: 27 Sep 2011 02:07

Re: libvlc_video_set_track

Postby Hildor » 27 Sep 2011 15:32

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.

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: libvlc_video_set_track

Postby mangokm40 » 27 Sep 2011 16:07

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

Hildor
New Cone
New Cone
Posts: 3
Joined: 27 Sep 2011 02:07

Re: libvlc_video_set_track

Postby Hildor » 27 Sep 2011 18:25

Yes

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: libvlc_video_set_track

Postby XilasZ » 02 Oct 2011 10:12

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 2 guests