Skip to content

Commit

Permalink
Incorrect use of two "int i" instances. (#3759)
Browse files Browse the repository at this point in the history
  • Loading branch information
lokenetwork authored Aug 9, 2023
1 parent 73dd8af commit fe38804
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions trunk/3rdparty/srs-bench/pcap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ func doMain(ctx context.Context) error {
}

if doRE {
if previousTime != nil {
if diff := ci.Timestamp.Sub(*previousTime); diff > 0 {
if previousTime == nil {
previousTime = &ci.Timestamp
} else {
if diff := ci.Timestamp.Sub(*previousTime); diff > 100*time.Millisecond {
time.Sleep(diff)
previousTime = &ci.Timestamp
}
}
previousTime = &ci.Timestamp
}

if doTrace {
Expand Down
4 changes: 2 additions & 2 deletions trunk/src/app/srs_app_threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ srs_error_t SrsThreadPool::run()
// Check the threads status fastly.
int loops = (int)(interval_ / SRS_UTIME_SECONDS);
for (int i = 0; i < loops; i++) {
for (int i = 0; i < (int)threads.size(); i++) {
SrsThreadEntry* entry = threads.at(i);
for (int j = 0; j < (int)threads.size(); j++) {
SrsThreadEntry* entry = threads.at(j);
if (entry->err != srs_success) {
// Quit with success.
if (srs_error_code(entry->err) == ERROR_THREAD_FINISHED) {
Expand Down

0 comments on commit fe38804

Please sign in to comment.