Skip to content

Commit

Permalink
limit MPV back cache too
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Jun 25, 2024
1 parent 396547d commit d9cec2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/player/mpv/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ func (p *Player) Init(maxCacheMB int) error {
m.SetOptionString("terminal", "no")

// limit in-memory cache size
m.SetOptionString("demuxer-max-bytes", fmt.Sprintf("%dMiB", maxCacheMB))
maxBackMB := maxCacheMB / 3
maxForwardMB := maxBackMB + maxBackMB
m.SetOptionString("demuxer-max-bytes", fmt.Sprintf("%dMiB", maxForwardMB))
m.SetOptionString("demuxer-max-back-bytes", fmt.Sprintf("%dMiB", maxBackMB))

if p.vol < 0 {
p.vol = 100
Expand Down

0 comments on commit d9cec2e

Please sign in to comment.