play: unable to load h264 stream

Issue #35 resolved
Trek Hopton created an issue

Currently streaming H264 via the play page isn’t working.

I found that the last time it was working was:

commit 0d95dcc1b2f404c69aea036896c68448a71ca922
Author: Scott <scott@ausocean.org>
Date:   Fri Jan 24 14:09:01 2020 +1030

    main: move error writing into getHandler function

Then the breaking change was:

commit c2bdeeef62c0a1e289a1afb000d0f5a2a052cc5f
Author: Scott <scott@ausocean.org>
Date:   Fri Jan 24 14:36:25 2020 +1030

    main: subhandlers return a tuple

The browser console shows:

VidGrind shows:

2020/02/03 18:47:08 /get?id=16&fd=10&out=live
2020/02/03 18:47:08 http: panic serving 127.0.0.1:54128: runtime error: index out of range [1] with length 1
goroutine 95 [running]:
net/http.(*conn).serve.func1(0xc0003480a0)
    /usr/local/go/src/net/http/server.go:1767 +0x139
panic(0xb29440, 0xc0000ca100)
    /usr/local/go/src/runtime/panic.go:679 +0x1b2
main.getHandler(0xc81280, 0xc000336b60, 0xc00010c000)
    /home/trek/go/src/bitbucket.org/ausocean/vidgrind/main.go:366 +0xa0c
net/http.HandlerFunc.ServeHTTP(0xbc0ec0, 0xc81280, 0xc000336b60, 0xc00010c000)
    /usr/local/go/src/net/http/server.go:2007 +0x44
net/http.(*ServeMux).ServeHTTP(0x1101de0, 0xc81280, 0xc000336b60, 0xc00010c000)
    /usr/local/go/src/net/http/server.go:2387 +0x1bd
net/http.serverHandler.ServeHTTP(0xc0003360e0, 0xc81280, 0xc000336b60, 0xc00010c000)
    /usr/local/go/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc0003480a0, 0xc82a80, 0xc0001fc540)
    /usr/local/go/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2928 +0x384

Comments (9)

  1. Trek Hopton reporter

    @Scott Barnard this issue is causing VidGrind to crash whenever an m3u playlist is requested. It needs to be fixed before we can proceed with HLS playback so could you have another look as soon as you can? TAI. Let me know if you need help reproducing the issue.

  2. Trek Hopton reporter

    I found that the culprit was line 366 in main.go, it’s an index out of range error because for some reason the mime type doesn’t have a slash where the code expects it to. There is a comment about this on this PR . I don’t know what it should be but I’ve made a fix and will make a PR for it shortly.

  3. Log in to comment