libvlc_video_set_subtitle_file not working
libvlc_video_set_subtitle_file 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 a = libvlc_video_set_subtitle_file(player, selectedFile.toStdString().c_str());
int a = 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));
设置特定文件前后的字幕索引和计数相同,函数返回1(int a)。
但是,使用libvlc_video_set_spu
设置字幕是有效的。
我使用的是VLC 2.2.1
如果您在Windows上,QDir::toNativeSeparators
将有所帮助:
const QString selectedFile = QFileDialog::getOpenFileName(this, "Open");
const QString nativePath = QDir::toNativeSeparators(selectedFile);
libvlc_video_set_subtitle_file(player, nativePath.toUtf8().constData());
相关文章:
- GDB - strcmp not working: __strcmp_sse2_unaligned
- QT qScriptConnect is not working
- QDesktopServices::openUrl() not working Qt
- C++ std::set ordering not working with customer class*
- C++ SetWindowText not working
- visual studio 2012 c++ hello world - iostream not working
- getGravity not working?
- Opencv findcontours CV_RETR_EXTERNAL not working
- c++ srand() not working
- std::queue::empty() not working?
- BCB swprintf not working
- 将类型作为指向另一个类的对象的指针的泛型类-NOT WORKING
- LoadLibrary is not working
- gluUnProject not working
- C++ catch bad_alloc not working
- updatelayeredwindow not working
- OpenMP set_num_threads() is not working
- glOrtho not working
- Cuda atomicInc not working
- WinAPI DestroyWindow not working