fallback to old sample edl if loading samplelist edl fails (which happens when veejay is not started in same dir as samplelist)

This commit is contained in:
niels
2015-06-02 23:05:36 +02:00
parent 79715b053c
commit 59d7dbc72f

View File

@@ -3253,12 +3253,14 @@ int sample_read_edl( sample_info *sample )
{
char *files[1];
int res = 0;
files[0] = strdup(sample->edit_list_file);
if(sample->edit_list)
{
veejay_msg(VEEJAY_MSG_ERROR, "Cleanup old editlist");
vj_el_free(sample->edit_list);
}
files[0] = sample->edit_list_file;
void *old = sample->edit_list;
//EDL is stored in CWD, samplelist file can be anywhere. Cannot always load samplelists due to
// missing EDL files in CWD.
veejay_msg(VEEJAY_MSG_DEBUG, "Loading '%s' from current working directory" , files[0] );
sample->edit_list = vj_el_init_with_args( files,1,
__sample_project_settings.flags,
__sample_project_settings.deinterlace,
@@ -3272,10 +3274,12 @@ int sample_read_edl( sample_info *sample )
{
res = 1;
sample->soft_edl = 0;
vj_el_free( old );
}
else
{
sample->edit_list = old;
}
if(files[0])
free(files[0]);
return res;
}