del fix for samsung tv

This commit is contained in:
YouROK
2025-04-25 15:33:35 +03:00
parent 20727dab0d
commit c784c0c908

View File

@@ -2,7 +2,6 @@ package torrstor
import ( import (
"io" "io"
"strings"
"sync" "sync"
"time" "time"
@@ -71,22 +70,22 @@ func (r *Reader) Read(p []byte) (n int, err error) {
n, err = r.Reader.Read(p) n, err = r.Reader.Read(p)
// samsung tv fix xvid/divx // samsung tv fix xvid/divx
if r.offset == 0 && len(p) >= 192 { //if r.offset == 0 && len(p) >= 192 {
str := strings.ToLower(string(p[112:116])) // str := strings.ToLower(string(p[112:116]))
if str == "xvid" || str == "divx" { // if str == "xvid" || str == "divx" {
p[112] = 0x4D // M // p[112] = 0x4D // M
p[113] = 0x50 // P // p[113] = 0x50 // P
p[114] = 0x34 // 4 // p[114] = 0x34 // 4
p[115] = 0x56 // V // p[115] = 0x56 // V
} // }
str = strings.ToLower(string(p[188:192])) // str = strings.ToLower(string(p[188:192]))
if str == "xvid" || str == "divx" { // if str == "xvid" || str == "divx" {
p[188] = 0x4D // M // p[188] = 0x4D // M
p[189] = 0x50 // P // p[189] = 0x50 // P
p[190] = 0x34 // 4 // p[190] = 0x34 // 4
p[191] = 0x56 // V // p[191] = 0x56 // V
} // }
} //}
r.offset += int64(n) r.offset += int64(n)
r.lastAccess = time.Now().Unix() r.lastAccess = time.Now().Unix()