Skip to content

Commit

Permalink
even more locks
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdarkdragon committed Mar 3, 2020
1 parent 6057717 commit c95d781
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/testdriver/testdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func main() {
*numStreamsStep,
sc,
func(s string, r *testdriver.Result) {
messenger.SendMessage(fmt.Sprintf("%s rtmp host: %s:%d / media port: %d using streamtester host: %s:%d - now testing %d concurrent streams with %d profiles",
messenger.SendMessage(fmt.Sprintf("%s rtmp host: %s:%d / media port: %d using streamtester host: %s:%d - now testing **%d** concurrent streams with %d profiles",
s, *ingestHost, *rtmpPort, *mediaPort, *streamTesterHost, *streamTesterPort, r.NumStreams, r.NumProfiles))
},
)
Expand Down
3 changes: 3 additions & 0 deletions internal/testers/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func (sr *streamer) startStreams(baseManfistID, sourceFileName string, repeatNum
glog.Infof("RTMP: %s", rtmpURL)
glog.Infof("MEDIA: %s", mediaURL)
if sr.mistMode {
time.Sleep(50 * time.Millisecond)
messenger.SendMessage(mediaURL)
}
var bar *uiprogress.Bar
Expand Down Expand Up @@ -368,6 +369,7 @@ func (sr *streamer) Stats(basedManifestID string) (*model.Stats, error) {
md.mu.Unlock()
}
}
mt.mu.RLock()
// find skipped keyframes number
skipSourceSegments := 0
var sourceTimes []time.Duration
Expand Down Expand Up @@ -418,6 +420,7 @@ func (sr *streamer) Stats(basedManifestID string) (*model.Stats, error) {
// glog.Infoln("\n" + strings.Join(dl.downloadedSegments, "\n"))
dl.mu.Unlock()
}
mt.mu.RUnlock()
stats.DownloadedSourceSegments -= skipSourceSegments
if sr.mistMode && stats.DownloadedSourceSegments > 0 {
stats.DownloadedSourceSegments--
Expand Down

0 comments on commit c95d781

Please sign in to comment.