mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-12 19:50:15 +08:00
Rewrite FLV/RTMP clients
This commit is contained in:
@@ -23,9 +23,6 @@ func streamsHandle(url string) (core.Producer, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = client.Describe(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return client, nil
|
||||
}
|
||||
|
||||
@@ -42,17 +39,12 @@ func apiHandle(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
client, err := flv.NewClient(r.Body)
|
||||
client, err := flv.Open(r.Body)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
if err = client.Describe(); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
stream.AddProducer(client)
|
||||
|
||||
if err = client.Start(); err != nil && err != io.EOF {
|
||||
|
Reference in New Issue
Block a user