projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
upgrade to ffmpeg-4.0, findobj upgrades, rework plugin visibility
[goodguy/history.git]
/
cinelerra-5.1
/
cinelerra
/
mwindow.C
diff --git
a/cinelerra-5.1/cinelerra/mwindow.C
b/cinelerra-5.1/cinelerra/mwindow.C
index 9731b4bbcb089d48aec86b183b3bf423c9dd3c9c..6150f954131af90569483dc305304075ff4c09d8 100644
(file)
--- a/
cinelerra-5.1/cinelerra/mwindow.C
+++ b/
cinelerra-5.1/cinelerra/mwindow.C
@@
-2263,32
+2263,37
@@
void MWindow::test_plugins(EDL *new_edl, char *path)
}
}
-void MWindow::init_shm()
+void MWindow::init_shm(
const char *pfn, int64_t min
)
{
{
+ int64_t result = 0;
// Fix shared memory
// Fix shared memory
- FILE *fd = fopen(
"/proc/sys/kernel/shmmax", "w
");
- if(
fd
) {
- f
printf(fd, "0x7fffffff"
);
+ FILE *fd = fopen(
pfn, "r
");
+ if(
fd
) {
+ f
scanf(fd, "%jd", &result
);
fclose(fd);
fclose(fd);
+ if( result >= min ) return;
}
}
- fd = 0;
- fd = fopen("/proc/sys/kernel/shmmax", "r");
- if(!fd) {
- MainError::show_error("MWindow::init_shm: couldn't open /proc/sys/kernel/shmmax for reading.\n");
+ fd = fopen(pfn, "w");
+ if( !fd ) return;
+ fprintf(fd, "0x%jx", min);
+ fclose(fd);
+
+ fd = fopen(pfn, "r");
+ if( !fd ) {
+ eprintf(_("MWindow::init_shm: couldn't open %s for reading.\n"), pfn);
return;
}
return;
}
- int64_t result = 0;
fscanf(fd, "%jd", &result);
fclose(fd);
fscanf(fd, "%jd", &result);
fclose(fd);
- fd = 0;
- if(result < 0x7fffffff) {
- eprintf(_("MWindow::init_shm: /proc/sys/kernel/shmmax is %p.\n"
+ if( result < min ) {
+ eprintf(_("MWindow::init_shm: %s is %p.\n"
"you probably need to be root, or:\n"
"you probably need to be root, or:\n"
- "as root, run: echo 0x
7fffffff > /proc/sys/kernel/shmmax
\n"
+ "as root, run: echo 0x
%jx > %s
\n"
"before trying to start cinelerra.\n"
"before trying to start cinelerra.\n"
- "It should be at least 0x7fffffff for Cinelerra.\n"), (void *)result);
+ "It should be at least 0x%jx for Cinelerra.\n"),
+ pfn, (void *)result, min, pfn, min);
}
}
}
}
@@
-2473,7
+2478,8
@@
void MWindow::create_objects(int want_gui,
&MWindowGUI::keyboard_listener);
hide_splash();
&MWindowGUI::keyboard_listener);
hide_splash();
- init_shm();
+ init_shm("/proc/sys/kernel/shmmax", 0x7fffffff);
+ init_shm("/proc/sys/kernel/shmmni", 0x4000);
if(debug) PRINT_TRACE
BC_WindowBase::get_resources()->vframe_shm = 1;
if(debug) PRINT_TRACE
BC_WindowBase::get_resources()->vframe_shm = 1;