Skip to content

Commit c47f16b

Browse files
committed
v1.4.2(55)
Fix ffplayer seek bug. Fix not respond bug on player when no network connection.
1 parent 8de1db1 commit c47f16b

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

ccViewer/CryptCloudViewer.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@
813813
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
814814
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
815815
CODE_SIGN_STYLE = Automatic;
816-
CURRENT_PROJECT_VERSION = 54;
816+
CURRENT_PROJECT_VERSION = 55;
817817
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
818818
DEVELOPMENT_TEAM = 7A9X38B4YU;
819819
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
@@ -848,7 +848,7 @@
848848
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
849849
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
850850
CODE_SIGN_STYLE = Automatic;
851-
CURRENT_PROJECT_VERSION = 54;
851+
CURRENT_PROJECT_VERSION = 55;
852852
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
853853
DEVELOPMENT_TEAM = 7A9X38B4YU;
854854
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;

ccViewer/ccViewer/CustomPlayerViewController.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,17 @@ class CustomPlayerView: NSObject, AVPlayerViewControllerDelegate {
507507

508508
func finishDisplay() {
509509
var ret = 0.0
510-
if let len = playerViewController.player?.currentItem?.asset.duration.seconds,
511-
let pos = playerViewController.player?.currentTime().seconds,
512-
pos < len - 2 {
513-
ret = pos
510+
let group = DispatchGroup()
511+
group.enter()
512+
DispatchQueue.global().async {
513+
defer {
514+
group.leave()
515+
}
516+
if let len = self.playerViewController.player?.currentItem?.asset.duration.seconds,
517+
let pos = self.playerViewController.player?.currentTime().seconds,
518+
pos < len - 2 {
519+
ret = pos
520+
}
514521
}
515522
playerViewController.player?.pause()
516523
iscancel = true
@@ -524,7 +531,9 @@ class CustomPlayerView: NSObject, AVPlayerViewControllerDelegate {
524531
}
525532
}
526533
self.customDelegate.removeAll()
527-
self.onFinish?(ret)
534+
group.notify(queue: .main) {
535+
self.onFinish?(ret)
536+
}
528537
}
529538
}
530539

ffplayer/ffplayer/player_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ int decode_thread(struct stream_param *stream)
378378
char buf[AV_ERROR_MAX_STRING_SIZE];
379379
char *errstr = av_make_error_string(buf, AV_ERROR_MAX_STRING_SIZE, ret1);
380380
av_log(NULL, AV_LOG_ERROR, "error avformat_seek_file() %d %s\n", ret1, errstr);
381-
error = true;
381+
//error = true;
382382
}
383383
if (ret1 >=0) {
384384
player->video.pictq_active_serial = player->subtitle.subpictq_active_serial = av_gettime();

0 commit comments

Comments
 (0)