1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #8981 from alalek:port_8979

This commit is contained in:
Maksim Shabunin
2017-06-26 09:25:23 +00:00
+9 -1
View File
@@ -694,7 +694,15 @@ CvCaptureFile::CvCaptureFile(const char* filename) {
return;
}
mAssetTrack = [[mAsset tracksWithMediaType: AVMediaTypeVideo][0] retain];
NSArray *tracks = [mAsset tracksWithMediaType:AVMediaTypeVideo];
if ([tracks count] == 0) {
fprintf(stderr, "OpenCV: Couldn't read video stream from 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);