Compare commits

..

No commits in common. "3bad711693774b32336da99fa9bf8b1c674df6bd" and "f9c5b5e0c6f281cd47ac582b439c42f05e9b9854" have entirely different histories.

6 changed files with 13 additions and 9 deletions

3
.gitignore vendored
View File

@ -22,11 +22,8 @@ _testmain.go
# built binaries
uplink
*.exe
*.dll
*.test
*.orig
###############################################################################
# Windows image file caches

View File

@ -4,7 +4,6 @@ import (
"io"
"io/ioutil"
"os"
"path/filepath"
"sync"
"testing"
@ -14,7 +13,7 @@ import (
func Test_Demux(t *testing.T) {
Convey("Demuxer", t, func() {
Convey("audio-only", func() {
reader, _ := os.Open(filepath.Join("testassets", "mpthreetest.mp3"))
reader, _ := os.Open("testassets/mpthreetest.mp3")
defer reader.Close()
demuxer := Demux(reader)
@ -44,7 +43,7 @@ func Test_Demux(t *testing.T) {
})
Convey("video and audio", func() {
reader, _ := os.Open(filepath.Join("testassets", "small.ogv"))
reader, _ := os.Open("testassets/small.ogv")
defer reader.Close()
demuxer := Demux(reader)

View File

@ -4,7 +4,6 @@ import (
"io"
"io/ioutil"
"os"
"path/filepath"
"testing"
. "github.com/smartystreets/goconvey/convey"
@ -13,7 +12,7 @@ import (
func Test_Muxer(t *testing.T) {
Convey("Muxer", t, func() {
Convey("audio-only", func() {
reader, _ := os.Open(filepath.Join("testassets", "mpthreetest.mp3"))
reader, _ := os.Open("testassets/mpthreetest.mp3")
defer reader.Close()
demuxer := Demux(reader)

View File

@ -75,6 +75,8 @@ func (instance *pluginInstance) Init() {
sr := container.Sub()
defer sr.Close()
log.Println("Someone tuned in to", channelId, channel)
if sendMetadata {
mw = streams.NewMetadataInjector(w, metaInt)
nw = mw

View File

@ -22,6 +22,8 @@ func (instance *pluginInstance) Init() {
channelManager := instance.channelManager
go func() {
time.Sleep(2 * time.Second) // give burst cache a chance to realize
c, err := channelManager.Open("sine")
if err != nil {
log.Println("ERROR: sine channel could not be opened:", err)

View File

@ -43,11 +43,16 @@ func (stream *SineStream) Read(data []byte) (n int, err error) {
targetTime := stream.Timestamp.
Add(time.Duration(float64(time.Second) * float64(stream.State) / float64(stream.Samplerate)))
delay := targetTime.Sub(time.Now())
/*log.Println("state", stream.State, "value", sampleValue, "time", targetTime, "delay", delay)
time.Sleep(time.Second)*/
if delay > 0 {
<-time.After(delay)
}
/*if stream.State%uint64(stream.Samplerate) == 0 {
log.Println("state", stream.State, "value", sampleValue, "time", targetTime, "delay", delay)
}*/
stream.State++
}