mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +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
@@ -199,6 +199,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu
|
||||
* [Kuzmin Vladimir](https://github.com/tekig)
|
||||
* [Alessandro Ros](https://github.com/aler9)
|
||||
* [Thomas Miller](https://github.com/tmiv)
|
||||
* [yoko(q191201771)](https://github.com/q191201771)
|
||||
|
||||
### License
|
||||
MIT License - see [LICENSE](LICENSE) for full text
|
||||
|
@@ -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