mirror of
https://github.com/Danile71/go-rtsp.git
synced 2025-10-19 22:44:41 +08:00
add timeout, return 0 instead 1 code
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/Danile71/go-logger"
|
"github.com/Danile71/go-logger"
|
||||||
"github.com/Danile71/go-rtsp"
|
"github.com/Danile71/go-rtsp"
|
||||||
@@ -23,10 +24,11 @@ func main() {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
|
time.Sleep(time.Millisecond * 4)
|
||||||
pkt, err := stream.ReadPacket()
|
pkt, err := stream.ReadPacket()
|
||||||
if logger.OnError(err) {
|
if logger.OnError(err) {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
os.Exit(1)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user