Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(h265) : Set nuStart value to 0 on end event #1294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ktakahiro150397
Copy link

When I streamed with OBS with h265, I got "slice bounds out of range" error.

panic: runtime error: slice bounds out of range [64644:19279]

goroutine 498 [running]:
github.com/AlexxIT/go2rtc/pkg/mp4.(*Consumer).AddTrack.RTPDepay.func4(0xc0008a3d40)
        github.com/AlexxIT/go2rtc/pkg/h265/rtp.go:57 +0x8eb
github.com/AlexxIT/go2rtc/pkg/core.NewSender.func2(0xc0008857a0?)
        github.com/AlexxIT/go2rtc/pkg/core/track.go:112 +0x1b
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1()
        github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x47
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 444
        github.com/AlexxIT/go2rtc/pkg/core/track.go:142 +0x10a

Logging nuStart for confirmation , there is wired value when error occur.

[h265] end nuStart=1770, len(buf): 20835
[h265] end nuStart=19, len(buf): 1645
[h265] end nuStart=1645, len(buf): 20834
[h265] end nuStart=293892, len(buf): 306731
[h265] end nuStart=293892, len(buf): 42610
[h265] nuStart > buf_len: 293892 > 42610. This will cause something error?

panic: runtime error: slice bounds out of range [293892:42610]

goroutine 1069 [running]:
github.com/AlexxIT/go2rtc/pkg/mp4.(*Consumer).AddTrack.RTPDepay.func4(0xc0005cf5f0)
        C:/Users/Takahiro/Documents/VSCode/go2rtc/pkg/h265/rtp.go:66 +0xb52
github.com/AlexxIT/go2rtc/pkg/core.NewSender.func2(0xc000aeacf0?)
        C:/Users/Takahiro/Documents/VSCode/go2rtc/pkg/core/track.go:112 +0x1b
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1()
        C:/Users/Takahiro/Documents/VSCode/go2rtc/pkg/core/track.go:144 +0x47
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 495
        C:/Users/Takahiro/Documents/VSCode/go2rtc/pkg/core/track.go:142 +0x10a

I think sometimes start event is not occur because of network issue, and nuStart is not initialized properly.
So, I add nuStart = 0 line.

After add this line, the error is not occur! (stream stuff 6h over)

Thanks for your great development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant