add missing ffmpeg encoder flush, bdwrite leaks + fixes
[goodguy/history.git] / cinelerra-5.0 / cinelerra / file.C
index b7d816d9b79618a848a75f22653728dc45b0ab71..c574921886e30ae954913b338e2e37f8a703a7dc 100644 (file)
@@ -2560,3 +2560,22 @@ int File::record_fd()
 }
 
 
+void get_exe_path(char *result)
+{
+// Get executable path
+       pid_t pid = getpid();
+       char proc_path[BCTEXTLEN];
+       int len = 0;
+       result[0] = 0;
+       sprintf(proc_path, "/proc/%d/exe", pid);
+       if((len = readlink(proc_path, result, BCTEXTLEN)) >= 0)
+       {
+               result[len] = 0;
+//printf("Preferences::Preferences %d %s\n", __LINE__, result);
+               char *ptr = strrchr(result, '/');
+               if(ptr) *ptr = 0;
+       }
+
+}
+
+