projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change thread join strategy, fix a few leaks, fix a few bugs
[goodguy/history.git]
/
cinelerra-5.1
/
cinelerra
/
preferences.C
diff --git
a/cinelerra-5.1/cinelerra/preferences.C
b/cinelerra-5.1/cinelerra/preferences.C
index 0eca68eb76919e43390d05f09904159a449efc16..a3f3b391f3062f05fe988b9ec14c0943d9b38680 100644
(file)
--- a/
cinelerra-5.1/cinelerra/preferences.C
+++ b/
cinelerra-5.1/cinelerra/preferences.C
@@
-698,18
+698,16
@@
int Preferences::get_node_port(int number)
int Preferences::get_asset_file_path(Asset *asset, char *path)
{
strcpy(path, asset->path);
int Preferences::get_asset_file_path(Asset *asset, char *path)
{
strcpy(path, asset->path);
- int result =
access(path, R_OK)
;
+ int result =
!access(path, R_OK) ? 0 : -1
;
if( !result && asset->format == FILE_MPEG ) {
if( !result && asset->format == FILE_MPEG ) {
- char source_filename[BCTEXTLEN];
- char index_filename[BCTEXTLEN];
+ char source_filename[BCTEXTLEN], index_filename[BCTEXTLEN];
IndexFile::get_index_filename(source_filename,
IndexFile::get_index_filename(source_filename,
- index_directory, index_filename,
- asset->path, ".toc");
- struct stat st;
- if( !access(index_filename, R_OK) &&
- !stat(index_filename,&st) && st.st_size > 0 )
+ index_directory, index_filename, asset->path, ".toc");
strcpy(path, index_filename);
strcpy(path, index_filename);
+ if( access(path, R_OK) )
+ result = 1;
}
}
+// result = 0, asset->path/toc exist, -1 no asset, 1 no toc
return result;
}
return result;
}