Skip to content

Commit

Permalink
v1.4.2(55)
Browse files Browse the repository at this point in the history
Fix ffplayer seek bug.
Fix not respond bug on player when no network connection.
  • Loading branch information
lithium0003 committed Nov 21, 2019
1 parent 8de1db1 commit c47f16b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ccViewer/CryptCloudViewer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = 7A9X38B4YU;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
Expand Down Expand Up @@ -848,7 +848,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 54;
CURRENT_PROJECT_VERSION = 55;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = 7A9X38B4YU;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
Expand Down
19 changes: 14 additions & 5 deletions ccViewer/ccViewer/CustomPlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,17 @@ class CustomPlayerView: NSObject, AVPlayerViewControllerDelegate {

func finishDisplay() {
var ret = 0.0
if let len = playerViewController.player?.currentItem?.asset.duration.seconds,
let pos = playerViewController.player?.currentTime().seconds,
pos < len - 2 {
ret = pos
let group = DispatchGroup()
group.enter()
DispatchQueue.global().async {
defer {
group.leave()
}
if let len = self.playerViewController.player?.currentItem?.asset.duration.seconds,
let pos = self.playerViewController.player?.currentTime().seconds,
pos < len - 2 {
ret = pos
}
}
playerViewController.player?.pause()
iscancel = true
Expand All @@ -524,7 +531,9 @@ class CustomPlayerView: NSObject, AVPlayerViewControllerDelegate {
}
}
self.customDelegate.removeAll()
self.onFinish?(ret)
group.notify(queue: .main) {
self.onFinish?(ret)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion ffplayer/ffplayer/player_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ int decode_thread(struct stream_param *stream)
char buf[AV_ERROR_MAX_STRING_SIZE];
char *errstr = av_make_error_string(buf, AV_ERROR_MAX_STRING_SIZE, ret1);
av_log(NULL, AV_LOG_ERROR, "error avformat_seek_file() %d %s\n", ret1, errstr);
error = true;
//error = true;
}
if (ret1 >=0) {
player->video.pictq_active_serial = player->subtitle.subpictq_active_serial = av_gettime();
Expand Down

0 comments on commit c47f16b

Please sign in to comment.