[opencv] 36/53: Unhandled Objective-C exception when playing video

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 2.4.13.3
in repository opencv.

commit f71bf21aaffec67739390c9fb58eafed68a35eae
Author: Sabelo <sabelo at sabelo.io>
Date:   Fri Jun 23 19:54:56 2017 -0400

    Unhandled Objective-C exception when playing video
---
 modules/highgui/src/cap_avfoundation_mac.mm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/highgui/src/cap_avfoundation_mac.mm b/modules/highgui/src/cap_avfoundation_mac.mm
index b5e3ffc..c56795d 100644
--- a/modules/highgui/src/cap_avfoundation_mac.mm
+++ b/modules/highgui/src/cap_avfoundation_mac.mm
@@ -697,7 +697,15 @@ CvCaptureFile::CvCaptureFile(const char* filename) {
         return;
     }
 
-    mAssetTrack = [[mAsset tracksWithMediaType: AVMediaTypeVideo][0] retain];
+    NSArray *tracks = [mAsset tracksWithMediaType:AVMediaTypeAudio];
+    if ([tracks count] == 0) {
+      fprintf(stderr, "OpenCV: Couldn't read movie file \"%s\"\n", filename);
+      [localpool drain];
+      started = 0;
+      return;
+    }
+
+    mAssetTrack = [tracks[0] retain];
 
     if ( ! setupReadingAt(kCMTimeZero) ) {
         fprintf(stderr, "OpenCV: Couldn't read movie file \"%s\"\n", filename);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list