Commit 0caff89556fb0c334b51255738af2a87818e39ec

Authored by 梁星国
1 parent dcb08329

提交0.1.15

CNLiveUploadManager.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveUploadManager' 10 s.name = 'CNLiveUploadManager'
11 - s.version = '0.1.14' 11 + s.version = '0.1.15'
12 s.summary = '压缩上传,组件化中加入新参数加入outPath,不在直接取' 12 s.summary = '压缩上传,组件化中加入新参数加入outPath,不在直接取'
13 13
14 # This description is used to generate tags and improve search results. 14 # This description is used to generate tags and improve search results.
CNLiveUploadManager/Classes/CNLiveUploadManager.m
@@ -2291,12 +2291,11 @@ static CNLiveUploadManager *_uploadManager; @@ -2291,12 +2291,11 @@ static CNLiveUploadManager *_uploadManager;
2291 shortVideoTranscoder.videoFrameRate = 0; //帧率 2291 shortVideoTranscoder.videoFrameRate = 0; //帧率
2292 2292
2293 2293
2294 - 2294 + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
2295 [PLShortVideoRecorder checkAuthentication:^(PLSAuthenticationResult result) { 2295 [PLShortVideoRecorder checkAuthentication:^(PLSAuthenticationResult result) {
2296 2296
2297 if (PLSAuthenticationResultAuthorized == result) {//授权 2297 if (PLSAuthenticationResultAuthorized == result) {//授权
2298 2298
2299 - dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);  
2300 //成功 2299 //成功
2301 [shortVideoTranscoder setCompletionBlock:^(NSURL *url){ 2300 [shortVideoTranscoder setCompletionBlock:^(NSURL *url){
2302 NSLog(@"输出转码后视频路径%@",url.path); 2301 NSLog(@"输出转码后视频路径%@",url.path);
@@ -2319,18 +2318,22 @@ static CNLiveUploadManager *_uploadManager; @@ -2319,18 +2318,22 @@ static CNLiveUploadManager *_uploadManager;
2319 2318
2320 NSLog(@"transCoding progress: %f", progress); 2319 NSLog(@"transCoding progress: %f", progress);
2321 !progressCount ? : progressCount(progress); 2320 !progressCount ? : progressCount(progress);
  2321 +
2322 }]; 2322 }];
2323 2323
2324 [shortVideoTranscoder startTranscoding]; 2324 [shortVideoTranscoder startTranscoding];
2325 - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); 2325 +
2326 }else{//未授权 2326 }else{//未授权
2327 2327
2328 !failure ? : failure(); 2328 !failure ? : failure();
  2329 + dispatch_semaphore_signal(semaphore);
2329 } 2330 }
2330 2331
2331 2332
2332 }]; 2333 }];
2333 2334
  2335 + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
  2336 +
2334 2337
2335 2338
2336 } 2339 }