File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,14 @@ func doMain(ctx context.Context) error {
108108 }
109109
110110 if doRE {
111- if previousTime != nil {
112- if diff := ci .Timestamp .Sub (* previousTime ); diff > 0 {
111+ if previousTime == nil {
112+ previousTime = & ci .Timestamp
113+ } else {
114+ if diff := ci .Timestamp .Sub (* previousTime ); diff > 100 * time .Millisecond {
113115 time .Sleep (diff )
116+ previousTime = & ci .Timestamp
114117 }
115118 }
116- previousTime = & ci .Timestamp
117119 }
118120
119121 if doTrace {
Original file line number Diff line number Diff line change @@ -693,8 +693,8 @@ srs_error_t SrsThreadPool::run()
693693 // Check the threads status fastly.
694694 int loops = (int )(interval_ / SRS_UTIME_SECONDS);
695695 for (int i = 0 ; i < loops; i++) {
696- for (int i = 0 ; i < (int )threads.size (); i ++) {
697- SrsThreadEntry* entry = threads.at (i );
696+ for (int j = 0 ; j < (int )threads.size (); j ++) {
697+ SrsThreadEntry* entry = threads.at (j );
698698 if (entry->err != srs_success) {
699699 // Quit with success.
700700 if (srs_error_code (entry->err ) == ERROR_THREAD_FINISHED) {
You can’t perform that action at this time.
0 commit comments