X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=de49bcf436aeead88135ae27e3e7b18bbc71e465;hb=9bdcade2e925eed0fdff09902b2e2aa1a99f8573;hp=714e9dddd17d7d6b8441959f1cf1688598c1d0fb;hpb=420671be045c7fcc1624d68395cb833a5cc2de31;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 714e9ddd..de49bcf4 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -106,6 +106,7 @@ #include "transition.h" #include "transportque.h" #include "vframe.h" +#include "versioninfo.h" #include "videodevice.inc" #include "videowindow.h" #include "vplayback.h" @@ -213,6 +214,7 @@ MWindow::MWindow() restart_status = 0; screens = 1; in_destructor = 0; + warn_version = 1; } @@ -339,8 +341,8 @@ MWindow::~MWindow() void MWindow::quit(int unlock) { - stop_playback(1); if(unlock) gui->unlock_window(); + stop_playback(1); brender_lock->lock("MWindow::quit"); delete brender; brender = 0; @@ -1499,7 +1501,29 @@ SET_TRACE if(debug) printf("MWindow::load_filenames %d\n", __LINE__); xml_file.read_from_file(filenames->get(i)); if(debug) printf("MWindow::load_filenames %d\n", __LINE__); - + const char *cin_version = 0; + while( !xml_file.read_tag() ) { + if( xml_file.tag.title_is("EDL") ) { + cin_version = xml_file.tag.get_property("VERSION"); + break; + } + } + xml_file.rewind(); + if( !cin_version ) { + eprintf(_("XML file %s\n not from cinelerra."),filenames->get(i)); + char string[BCTEXTLEN]; + sprintf(string,_("Unknown %s"), filenames->get(i)); + gui->show_message(string); + result = 1; + break; + } + if( strcmp(cin_version, CINELERRA_VERSION) ) { + char string[BCTEXTLEN]; + snprintf(string, sizeof(string), + _("Warning: XML from cinelerra version %s\n" + "Session data may be incompatible."), cin_version); + show_warning(&preferences->warn_version, string); + } if(load_mode == LOADMODE_NESTED) { // Load temporary EDL for nesting. @@ -3122,13 +3146,23 @@ void MWindow::dump_exe(FILE *fp) { char proc_path[BCTEXTLEN], exe_path[BCTEXTLEN]; sprintf(proc_path, "/proc/%d/exe", (int)getpid()); - int ret = readlink(proc_path, exe_path, sizeof(exe_path)); - if( ret < 0 ) { fprintf(fp,"readlink: %m\n"); return; } - exe_path[ret] = 0; + + int ret = -1, n = 100; + for( int len; (len=readlink(proc_path, exe_path, sizeof(exe_path)))>0; --n ) { + exe_path[len] = 0; strcpy(proc_path, exe_path); + ret = 0; + } + if( n < 0 || ret < 0 ) { fprintf(fp,"readlink: %m\n"); return; } + struct stat st; - if( stat(exe_path,&st) ) { fprintf(fp,"stat: %m\n"); return; } - fprintf(fp, "path: %s = %9jd bytes\n",exe_path,st.st_size); - int fd = open(exe_path,O_RDONLY+O_NONBLOCK); + if( stat(proc_path,&st) ) { fprintf(fp,"stat: %m\n"); return; } + fprintf(fp, "path: %s = %9jd bytes\n",proc_path,st.st_size); + struct tm *tm = localtime(&st.st_mtime); + char mtime[256]; + strftime(mtime, sizeof(mtime), "%F %T", tm); + fprintf(fp,"mtime: %s\n", mtime); + + int fd = open(proc_path,O_RDONLY+O_NONBLOCK); if( fd < 0 ) { fprintf(fp,"open: %m\n"); return; } uint8_t *bfr = 0; int64_t bfrsz = 0;