Merge pull request #17430 from alalek:issue_17257

pull/17455/head
Alexander Alekhin 5 years ago
commit 3ed243abde
  1. 15
      modules/videoio/src/cap_ffmpeg_impl.hpp

@ -1215,9 +1215,20 @@ bool CvCapture_FFMPEG::grabFrame()
#endif #endif
int ret = av_read_frame(ic, &packet); int ret = av_read_frame(ic, &packet);
if (ret == AVERROR(EAGAIN)) continue;
/* else if (ret < 0) break; */ if (ret == AVERROR(EAGAIN))
continue;
if (ret == AVERROR_EOF)
{
if (rawMode)
break;
// flush cached frames from video decoder
packet.data = NULL;
packet.size = 0;
packet.stream_index = video_stream;
}
if( packet.stream_index != video_stream ) if( packet.stream_index != video_stream )
{ {

Loading…
Cancel
Save