diff options
author | Robin Gareus <robin@gareus.org> | 2013-03-15 02:11:03 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-03-15 02:11:03 +0100 |
commit | 199e4b9c95d29012cac5c0c29db27c3385de86fd (patch) | |
tree | 9d6a0a4ce1e8cb6cbd7021c3d215cc65f80892d5 /gtk2_ardour/add_video_dialog.cc | |
parent | f0bb986b33519f3dd00db0110147024d72f86a62 (diff) |
vtl: also use video-monitor for files found using the index
Diffstat (limited to 'gtk2_ardour/add_video_dialog.cc')
-rw-r--r-- | gtk2_ardour/add_video_dialog.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gtk2_ardour/add_video_dialog.cc b/gtk2_ardour/add_video_dialog.cc index 05d7a27888..d6e18bb718 100644 --- a/gtk2_ardour/add_video_dialog.cc +++ b/gtk2_ardour/add_video_dialog.cc @@ -302,7 +302,28 @@ AddVideoDialog::file_name (bool &local_file) local_file = false; Gtk::TreeModel::iterator iter = harvid_list_view.get_selection()->get_selected(); if(!iter) return ""; - return (*iter)[harvid_list_columns.uri]; + + std::string uri = (*iter)[harvid_list_columns.uri]; + std::string video_server_url = Config->get_video_server_url(); + + /* check if video server is running locally */ + if (Config->get_video_server_docroot().size() > 0 + && !video_server_url.compare(0, 16, "http://localhost")) + { + /* check if the file can be accessed */ + int plen; + CURL *curl; + curl = curl_easy_init(); + char *ue = curl_easy_unescape(curl, uri.c_str(), uri.length(), &plen); + std::string path = Config->get_video_server_docroot() + ue; + if (!::access(path.c_str(), R_OK)) { + uri = path; + local_file = true; + } + curl_easy_cleanup(curl); + curl_free(ue); + } + return uri; } } |