mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 15:02:19 +00:00
use time.Second to wait for 5s
This commit is contained in:
parent
f3d38dc10d
commit
708501c5c8
@ -76,7 +76,7 @@ func TestForwardStream(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
time.Sleep(5000000000) // Delay is in nanoseconds, here 5s
|
||||
time.Sleep(5 * time.Second) // Delay is in nanoseconds, here 5s
|
||||
|
||||
// FIXME
|
||||
//if ffmpegInputStreams["demo"] == nil {
|
||||
|
@ -38,11 +38,10 @@ func TestServeSRT(t *testing.T) {
|
||||
|
||||
go Serve(&Options{ListenAddress: ":9711", MaxClients: 2}, nil, nil, nil)
|
||||
|
||||
ffmpeg := exec.Command("ffmpeg",
|
||||
"-i", "http://ftp.crans.org/events/Blender%20OpenMovies/big_buck_bunny_480p_stereo.ogg",
|
||||
ffmpeg := exec.Command("ffmpeg", "-hide_banner", "-loglevel", "error",
|
||||
"-f", "lavfi", "-i", "testsrc=size=640x480:rate=10",
|
||||
"-f", "flv", "srt://127.0.0.1:9711?streamid=demo:")
|
||||
|
||||
output, err := ffmpeg.StdoutPipe()
|
||||
errOutput, err := ffmpeg.StderrPipe()
|
||||
if err != nil {
|
||||
t.Fatal("Error while querying ffmpeg output:", err)
|
||||
@ -53,20 +52,13 @@ func TestServeSRT(t *testing.T) {
|
||||
}
|
||||
|
||||
go func() {
|
||||
scanner := bufio.NewScanner(output)
|
||||
scanner := bufio.NewScanner(errOutput)
|
||||
for scanner.Scan() {
|
||||
log.Printf("[FFMPEG TEST] %s", scanner.Text())
|
||||
}
|
||||
}()
|
||||
|
||||
go func() {
|
||||
scanner := bufio.NewScanner(errOutput)
|
||||
for scanner.Scan() {
|
||||
log.Printf("[FFMPEG ERR TEST] %s", scanner.Text())
|
||||
}
|
||||
}()
|
||||
|
||||
time.Sleep(5000000000) // Delay is in nanoseconds, here 5s
|
||||
time.Sleep(5 * time.Second) // Delay is in nanoseconds, here 5s
|
||||
|
||||
// TODO Check that the stream ran
|
||||
// TODO Kill SRT server
|
||||
|
Loading…
Reference in New Issue
Block a user