Skip to content

Commit

Permalink
Revert "test: add pkttimestamp and timestamp to samples to improve We…
Browse files Browse the repository at this point in the history
…bRTC streaming"

This reverts commit b067758.
  • Loading branch information
cedricve committed Aug 14, 2024
1 parent 8e8d51b commit 13d1948
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions machinery/src/webrtc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package webrtc
import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"strconv"
"sync"
Expand Down Expand Up @@ -410,15 +409,7 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
start = true
}
if start {
sample := pionMedia.Sample{
Data: pkt.Data,
Duration: bufferDuration,
//Timestamp: time.Unix(0, int64(pkt.Time)),
Timestamp: time.Now(),
PacketTimestamp: uint32(pkt.Time),
}
fmt.Println(sample)

sample := pionMedia.Sample{Data: pkt.Data, Duration: bufferDuration}
if config.Capture.ForwardWebRTC == "true" {
// We will send the video to a remote peer
// TODO..
Expand All @@ -445,12 +436,7 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
previousTimeAudio = pkt.Time

// We will send the audio
sample := pionMedia.Sample{
Data: pkt.Data,
Duration: bufferDuration,
Timestamp: time.Unix(0, int64(pkt.Time)),
PacketTimestamp: uint32(pkt.Time),
}
sample := pionMedia.Sample{Data: pkt.Data, Duration: bufferDuration}
if err := audioTrack.WriteSample(sample); err != nil && err != io.ErrClosedPipe {
log.Log.Error("webrtc.main.WriteToTrack(): something went wrong while writing sample: " + err.Error())
}
Expand Down

0 comments on commit 13d1948

Please sign in to comment.