mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-06 23:06:22 +09:00
Do not create output directory when live streaming
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -1921,8 +1921,16 @@ int main(int argc, char **argv) {
|
|||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_livestream = false;
|
||||||
const char *filename = args["-o"].value();
|
const char *filename = args["-o"].value();
|
||||||
if(filename) {
|
if(filename) {
|
||||||
|
is_livestream = is_livestream_path(filename);
|
||||||
|
if(is_livestream) {
|
||||||
|
if(replay_buffer_size_secs != -1) {
|
||||||
|
fprintf(stderr, "Error: replay mode is not applicable to live streaming\n");
|
||||||
|
_exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if(replay_buffer_size_secs == -1) {
|
if(replay_buffer_size_secs == -1) {
|
||||||
char directory_buf[PATH_MAX];
|
char directory_buf[PATH_MAX];
|
||||||
strcpy(directory_buf, filename);
|
strcpy(directory_buf, filename);
|
||||||
@@ -1945,6 +1953,7 @@ int main(int argc, char **argv) {
|
|||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if(replay_buffer_size_secs == -1) {
|
if(replay_buffer_size_secs == -1) {
|
||||||
filename = "/dev/stdout";
|
filename = "/dev/stdout";
|
||||||
@@ -2134,7 +2143,6 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
gsr_capture *capture = create_capture_impl(window_str, screen_region, wayland, egl.gpu_info, egl, fps, overclock, video_codec, color_range);
|
gsr_capture *capture = create_capture_impl(window_str, screen_region, wayland, egl.gpu_info, egl, fps, overclock, video_codec, color_range);
|
||||||
|
|
||||||
const bool is_livestream = is_livestream_path(filename);
|
|
||||||
// (Some?) livestreaming services require at least one audio track to work.
|
// (Some?) livestreaming services require at least one audio track to work.
|
||||||
// If not audio is provided then create one silent audio track.
|
// If not audio is provided then create one silent audio track.
|
||||||
if(is_livestream && requested_audio_inputs.empty()) {
|
if(is_livestream && requested_audio_inputs.empty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user