Skip to content

Commit

Permalink
Fix lint, vet and fmt errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean-Der committed Jul 4, 2018
1 parent 366f9ec commit 3b3ed9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/gstreamer-send/gst/gst.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ const (
)

//export goHandlePipelineBuffer
func goHandlePipelineBuffer(buffer unsafe.Pointer, bufferLen C.int, duration C.int, pipelineId C.int) {
func goHandlePipelineBuffer(buffer unsafe.Pointer, bufferLen C.int, duration C.int, pipelineID C.int) {
pipelinesLock.Lock()
defer pipelinesLock.Unlock()

if pipeline, ok := pipelines[int(pipelineId)]; ok {
if pipeline, ok := pipelines[int(pipelineID)]; ok {
var samples uint32
if pipeline.codec == webrtc.Opus {
samples = uint32(audioClockRate * (float32(duration) / 1000000000))
} else {
samples = uint32(videoClockRate * (float32(duration) / 1000000000))
}
pipeline.in <- webrtc.RTCSample{C.GoBytes(buffer, bufferLen), samples}
pipeline.in <- webrtc.RTCSample{Data: C.GoBytes(buffer, bufferLen), Samples: samples}
} else {
fmt.Printf("discarding buffer, no pipeline with id %d", int(pipelineId))
fmt.Printf("discarding buffer, no pipeline with id %d", int(pipelineID))
}
C.free(buffer)
}
3 changes: 2 additions & 1 deletion rtcpeerconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ func init() {
rand.Seed(time.Now().UTC().UnixNano())
}

// RTCSample contains media, and the amount of samples in it
type RTCSample struct {
Data []byte
Data []byte
Samples uint32
}

Expand Down

0 comments on commit 3b3ed9a

Please sign in to comment.