Skip to content

Commit

Permalink
Pass UTF-8 string to MLT in Mlt::Controller::open().
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy authored and Dan Dennedy committed May 18, 2014
1 parent e02a3a1 commit d4e317f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,12 @@ void MainWindow::open(const QString& url, const Mlt::Properties* properties)
setWindowModified(false);
MLT.resetURL();
}
if (!MLT.open(url.toUtf8().constData())) {
if (!MLT.open(url)) {
Mlt::Properties* props = const_cast<Mlt::Properties*>(properties);
if (props && props->is_valid())
mlt_properties_inherit(MLT.producer()->get_properties(), props->get_properties());
open(MLT.producer());
m_recentDock->add(url.toUtf8().constData());
m_recentDock->add(url);
}
else {
ui->statusBar->showMessage(tr("Failed to open ") + url, STATUS_TIMEOUT_MS);
Expand Down
8 changes: 4 additions & 4 deletions src/mltcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,25 @@ int Controller::setProducer(Mlt::Producer* producer, bool)
return error;
}

int Controller::open(const char* url)
int Controller::open(const QString &url)
{
int error = 0;

close();
m_producer = new Mlt::Producer(profile(), url);
m_producer = new Mlt::Producer(profile(), url.toUtf8().constData());
if (m_producer->is_valid()) {
double fps = profile().fps();
if (!profile().is_explicit())
profile().from_producer(*m_producer);
if (profile().fps() != fps) {
// reopen with the correct fps
delete m_producer;
m_producer = new Mlt::Producer(profile(), url);
m_producer = new Mlt::Producer(profile(), url.toUtf8().constData());
}
if (m_url.isEmpty() && QString(m_producer->get("xml")) == "was here") {
if (m_producer->get_int("_original_type") != tractor_type ||
(m_producer->get_int("_original_type") == tractor_type && m_producer->get("shotcut")))
m_url = QString::fromUtf8(url);
m_url = url;
}
const char *service = m_producer->get("mlt_service");
if (service && (!strcmp(service, "pixbuf") || !strcmp(service, "qimage")))
Expand Down
2 changes: 1 addition & 1 deletion src/mltcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Controller

virtual QWidget* videoWidget() = 0;
virtual int setProducer(Mlt::Producer*, bool isMulti = false);
virtual int open(const char* url);
virtual int open(const QString& url);
bool openXML(const QString& filename);
virtual void close();
virtual int displayWidth() const = 0;
Expand Down

0 comments on commit d4e317f

Please sign in to comment.