mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-14 11:33:43 +00:00
improved slowdown logic
This commit is contained in:
@@ -118,19 +118,23 @@ void stream_loop(stream_s *stream) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (atomic_load(&RUN(stop))) {
|
if (stream->slowdown) {
|
||||||
break;
|
for (unsigned slc = 0;
|
||||||
|
slc < 10
|
||||||
|
&& !atomic_load(&RUN(stop))
|
||||||
|
&& !atomic_load(&RUN(video->has_clients))
|
||||||
|
// has_clients синков НЕ обновляются в реальном времени
|
||||||
|
&& (stream->sink == NULL || !stream->sink->has_clients)
|
||||||
|
# ifdef WITH_OMX
|
||||||
|
&& (RUN(h264) == NULL || /*RUN(h264->sink) == NULL ||*/ !RUN(h264->sink->has_clients))
|
||||||
|
# endif
|
||||||
|
; ++slc) {
|
||||||
|
usleep(100000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (atomic_load(&RUN(stop))) {
|
||||||
stream->slowdown
|
break;
|
||||||
&& !atomic_load(&RUN(video->has_clients))
|
|
||||||
&& (stream->sink == NULL || !stream->sink->has_clients)
|
|
||||||
# ifdef WITH_OMX
|
|
||||||
&& (RUN(h264) == NULL || /*RUN(h264->sink) == NULL ||*/ !RUN(h264->sink->has_clients))
|
|
||||||
# endif
|
|
||||||
) {
|
|
||||||
usleep(1000000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool has_read;
|
bool has_read;
|
||||||
|
|||||||
Reference in New Issue
Block a user