Skip to content

Commit

Permalink
fix 图片字幕一直存在的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslay committed Apr 23, 2024
1 parent b96f145 commit 3384255
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Sources/KSPlayer/MEPlayer/FFmpegAssetTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public class FFmpegAssetTrack: MediaPlayerTrack {
if timebase.num <= 0 || timebase.den <= 0 {
timebase = Timebase(num: 1, den: 1000)
}
startTime = timebase.cmtime(for: stream.pointee.start_time)
if stream.pointee.start_time != Int64.min {
startTime = timebase.cmtime(for: stream.pointee.start_time)
}
self.timebase = timebase
avgFrameRate = Timebase(stream.pointee.avg_frame_rate)
realFrameRate = Timebase(stream.pointee.r_frame_rate)
Expand Down
2 changes: 1 addition & 1 deletion Sources/KSPlayer/MEPlayer/SubtitleDecode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SubtitleDecode: DecodeProtocol {
duration = packet.assetTrack.timebase.cmtime(for: packet.duration).seconds
}
if let preSubtitleFrame, preSubtitleFrame.part.end == preSubtitleFrame.part.start {
if start == preSubtitleFrame.part.end {
if preSubtitleFrame.part.end >= start {
return
} else {
preSubtitleFrame.part.end = start
Expand Down

0 comments on commit 3384255

Please sign in to comment.