- for(int i = 0; i < jobs.total; i++)
- {
- if(jobs.values[i]->enabled)
- {
- const char *path = jobs.values[i]->edl_path;
- if( *path == '@' ) ++path;
- FILE *fd = fopen(path, "r");
- if(!fd)
- {
- char string[BCTEXTLEN];
- sprintf(string, _("EDL %s not found.\n"), jobs.values[i]->edl_path);
- if(mwindow)
- {
- ErrorBox error_box(_(PROGRAM_NAME ": Error"),
- mwindow->gui->get_abs_cursor_x(1),
- mwindow->gui->get_abs_cursor_y(1));
- error_box.create_objects(string);
- error_box.run_window();
- gui->button_enable();
+ int not_equiv = 0, ret = 0;
+ const char *path = 0;
+
+ for( int i=0; !ret && i<jobs.size(); ++i ) {
+ if( !jobs.values[i]->enabled ) continue;
+ const char *path = jobs.values[i]->edl_path;
+ int is_script = *path == '@' ? 1 : 0;
+ if( is_script ) ++path;
+ FILE *fp = fopen(path, "r");
+ if( fp ) {
+ if( warn && mwindow && !is_script ) {
+ fseek(fp, 0, SEEK_END);
+ int64_t sz = ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ char *bfr = new char[sz+1];
+ int64_t len = fread(bfr, 1, sz+1, fp);
+ if( len == sz ) {
+ FileXML file; file.set_shared_input(bfr, len);
+ EDL *edl = new EDL; edl->create_objects();
+ edl->load_xml(&file, LOAD_ALL);
+ double pos = edl->equivalent_output(mwindow->edl);
+ if( pos >= 0 ) ++not_equiv;
+ edl->remove_user();