Compare commits

...

3 Commits

Author SHA1 Message Date
Icedream 3bad711693
Update .gitignore. 2018-07-09 12:37:00 +02:00
Icedream f5a86e9282
Remove debug lines. 2018-07-09 12:36:54 +02:00
Icedream 4dc3a544f7
Use properly joined file paths. 2018-07-09 12:35:18 +02:00
6 changed files with 9 additions and 13 deletions

3
.gitignore vendored
View File

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

View File

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

View File

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

View File

@ -75,8 +75,6 @@ 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,8 +22,6 @@ 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,16 +43,11 @@ 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++
}