mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 07:06:51 +08:00
Fix error checking
Wrong error variable was checked and redundant parentheses in play-from-disk example.
This commit is contained in:

committed by
Tarrence van As

parent
0466659207
commit
c2ed6ee835
@@ -63,7 +63,7 @@ func main() {
|
||||
if addTrackErr != nil {
|
||||
panic(addTrackErr)
|
||||
}
|
||||
if _, addTrackErr = peerConnection.AddTrack(videoTrack); err != nil {
|
||||
if _, addTrackErr = peerConnection.AddTrack(videoTrack); addTrackErr != nil {
|
||||
panic(addTrackErr)
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ func main() {
|
||||
if addTrackErr != nil {
|
||||
panic(addTrackErr)
|
||||
}
|
||||
if _, addTrackErr = peerConnection.AddTrack(audioTrack); err != nil {
|
||||
if _, addTrackErr = peerConnection.AddTrack(audioTrack); addTrackErr != nil {
|
||||
panic(addTrackErr)
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ func main() {
|
||||
}
|
||||
|
||||
// The amount of samples is the difference between the last and current timestamp
|
||||
sampleCount := float64((pageHeader.GranulePosition - lastGranule))
|
||||
sampleCount := float64(pageHeader.GranulePosition - lastGranule)
|
||||
lastGranule = pageHeader.GranulePosition
|
||||
|
||||
if oggErr = audioTrack.WriteSample(media.Sample{Data: pageData, Samples: uint32(sampleCount)}); oggErr != nil {
|
||||
|
Reference in New Issue
Block a user