mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-06 00:37:25 +08:00
fix: mp4 download
This commit is contained in:
@@ -249,13 +249,14 @@ func (p *MP4Plugin) download(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
if i == 0 {
|
||||
startTimestamp := startTime.Sub(stream.StartTime).Milliseconds()
|
||||
if startTimestamp > 0 {
|
||||
var startSample *box.Sample
|
||||
if startSample, err = demuxer.SeekTime(uint64(startTimestamp)); err != nil {
|
||||
tsOffset = 0
|
||||
continue
|
||||
}
|
||||
tsOffset = -int64(startSample.Timestamp)
|
||||
}
|
||||
}
|
||||
var part *ContentPart
|
||||
for track, sample := range demuxer.RangeSample {
|
||||
if i == streamCount-1 && int64(sample.Timestamp) > endTime.Sub(stream.StartTime).Milliseconds() {
|
||||
|
Reference in New Issue
Block a user