add protection against EAGAIN error in the streams (thanks to vrabaud for the patch...
authorVadim Pisarevsky <no@email>
Mon, 22 Nov 2010 13:07:43 +0000 (13:07 +0000)
committerVadim Pisarevsky <no@email>
Mon, 22 Nov 2010 13:07:43 +0000 (13:07 +0000)
modules/highgui/src/cap_ffmpeg.cpp

index def8eb5..ee59ae1 100644 (file)
@@ -538,7 +538,13 @@ bool CvCapture_FFMPEG::grabFrame()
     }
 
     // get the next frame
-    while (!valid && (av_read_frame(ic, &packet) >= 0)) {
+    while (!valid) {
+        int ret = av_read_frame(ic, &packet);
+        if (ret == AVERROR(EAGAIN))
+            continue;
+        if (ret < 0)
+            break;
+        
                if( packet.stream_index != video_stream ) {
                        av_free_packet (&packet);
                        continue;