c++ - libvlc_video_set_subtitle_file not working -


i'm using following code set subtitle file, reason it's not working.

qstring selectedfile = qfiledialog::getopenfilename(this, "open");  if(selectedfile == null) {     return; }  qdebug("before %d %d", libvlc_video_get_spu(player), libvlc_video_get_spu_count(player));  //int = libvlc_video_set_subtitle_file(player, selectedfile.tostdstring().c_str()); int = libvlc_video_set_subtitle_file(player, selectedfile.tolatin1().data());  qdebug("a = %d",a);  qdebug("after %d %d", libvlc_video_get_spu(player), libvlc_video_get_spu_count(player)); 

subtitle index , count same before , after setting specific file, , function returns 1 (int a).

however, setting subtitle libvlc_video_set_spu works.

i'm using vlc 2.2.1

if on windows,qdir::tonativeseparators help:

const qstring selectedfile = qfiledialog::getopenfilename(this, "open"); const qstring nativepath = qdir::tonativeseparators(selectedfile); libvlc_video_set_subtitle_file(player, nativepath.toutf8().constdata()); 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -