FS-11436 more granularly calculate 'samples' and modify requested 'fsp' accordingly

+ review all places where it used and reflect that 'fps' is (float)
This commit is contained in:
Sergey Khripchenko authored and Andrey Volk committed 2019-07-16 20:26:32 +04:00
1 parent be7c5331f6
commit c546154d67
4 files changed
+27 -24

No files matched your search

+7 -5
View File
@@ -599,11 +599,11 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void *
switch_frame_t frame = { 0 };
switch_timer_t timer = { 0 };
switch_mm_t mm = { 0 };
int fps = 15;
int vw = 1280;
int vh = 720;
int last_w = 0, last_h = 0, other_last_w = 0, other_last_h = 0;
switch_fps_t fps_data = { 0 };
float fps;
switch_rgb_color_t color = { 0 };
switch_color_set_rgb(&color, "#000000");
@@ -628,14 +628,16 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void *
switch_core_media_bug_get_media_params(bug, &mm);
if (mm.fps) {
fps = (int) mm.fps;
}
if (mm.vw) vw = mm.vw;
if (mm.vh) vh = mm.vh;
if (mm.fps) {
fps = mm.fps;
} else {
fps = 15;
}
switch_calc_video_fps(&fps_data, fps);
switch_core_timer_init(&timer, "soft", fps_data.ms, fps_data.samples, NULL);
while (bug->ready) {