diff options
author | Robin Gareus <robin@gareus.org> | 2018-11-21 00:05:13 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-11-21 00:05:13 +0100 |
commit | 79731a716deae9a90be646695480f06f92c268f5 (patch) | |
tree | 2c3cb3991409c063caa7690595a03525663ca0c7 /gtk2_ardour/transcode_ffmpeg.cc | |
parent | d6a92dc521840530d2ea8499d9d3cf75a32a1df8 (diff) |
Update GUI, use/remove meta-data methods that have been migrated to the backend
Diffstat (limited to 'gtk2_ardour/transcode_ffmpeg.cc')
-rw-r--r-- | gtk2_ardour/transcode_ffmpeg.cc | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/gtk2_ardour/transcode_ffmpeg.cc b/gtk2_ardour/transcode_ffmpeg.cc index 3b3239c2ef..a26c7622f5 100644 --- a/gtk2_ardour/transcode_ffmpeg.cc +++ b/gtk2_ardour/transcode_ffmpeg.cc @@ -295,38 +295,6 @@ TranscodeFfmpeg::default_meta_data () return ffm; } -char * -TranscodeFfmpeg::format_metadata (std::string key, std::string value) -{ - size_t start_pos = 0; - std::string v1 = value; - while((start_pos = v1.find_first_not_of( - "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789(),.\"'", - start_pos)) != std::string::npos) - { - v1.replace(start_pos, 1, "_"); - start_pos += 1; - } - - start_pos = 0; - while((start_pos = v1.find("\"", start_pos)) != std::string::npos) { - v1.replace(start_pos, 1, "\\\""); - start_pos += 2; - } - - size_t len = key.length() + v1.length() + 4; - char *mds = (char*) calloc(len, sizeof(char)); -#ifdef PLATFORM_WINDOWS - /* SystemExec::make_wargs() adds quotes around the complete argument - * windows uses CreateProcess() with a parameter string - * (and not an array list of separate arguments) - */ - snprintf(mds, len, "%s=%s", key.c_str(), v1.c_str()); -#else - snprintf(mds, len, "%s=\"%s\"", key.c_str(), v1.c_str()); -#endif - return mds; -} bool TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf_v, TranscodeFfmpeg::FFSettings ffs, TranscodeFfmpeg::FFSettings meta, bool map) @@ -354,7 +322,7 @@ TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf } for(TranscodeFfmpeg::FFSettings::const_iterator it = meta.begin(); it != meta.end(); ++it) { argp[a++] = strdup("-metadata"); - argp[a++] = format_metadata(it->first.c_str(), it->second.c_str()); + argp[a++] = SystemExec::format_key_value_parameter (it->first.c_str(), it->second.c_str()); } if (m_fps > 0) { |