I want to add audio tracks as slave to video. To do that I tried to use libvlc_media_slaves_add, but that function doesn't work.
VLC 3.0.17
My code
Code: Select all
...
libvlc_media_t* media = libvlc_media_new_path(vlcInstance, pathToVideo);
...
const char* slaveAudioPath1 = "F:\\\\Temp\\card_28_09_21\\CONTENTS\\AUDIO\\1105AH01.mxf";
const char* slaveAudioPath2 = "F:\\\\Temp\\card_28_09_21\\CONTENTS\\AUDIO\\1105AH01.mxf";
int ret = libvlc_media_slaves_add(media, libvlc_media_slave_type_audio, 4, slaveAudioPath1); // ret is 0
ret = libvlc_media_slaves_add(media, libvlc_media_slave_type_audio, 4, slaveAudioPath2); // ret is 0
auto status = libvlc_media_parse_with_options(media, libvlc_media_parse_local, -1);
libvlc_media_player_set_media(player, media);
libvlc_media_release(media);
...
libvlc_media_player_play(player);
...
If I add slave with
libvlc_media_add_option(media, (const char*)(std::string(":input-slave=") + slaveAudioPath1).c_str());
all ok and audio playing with video. But this option allow to add only 1 slave.