Commit 8c27ceb9 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #8981 from alalek:port_8979

parents b3cd2448 35a2f2fe
...@@ -694,7 +694,15 @@ CvCaptureFile::CvCaptureFile(const char* filename) { ...@@ -694,7 +694,15 @@ CvCaptureFile::CvCaptureFile(const char* filename) {
return; 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) ) { if ( ! setupReadingAt(kCMTimeZero) ) {
fprintf(stderr, "OpenCV: Couldn't read movie file \"%s\"\n", filename); fprintf(stderr, "OpenCV: Couldn't read movie file \"%s\"\n", filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment