mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
issues-22141
This commit is contained in:
parent
a6ca48a1c2
commit
44c2519d75
@ -1510,10 +1510,6 @@ bool CvCapture_FFMPEG::grabFrame()
|
||||
ret = got_picture ? 0 : -1;
|
||||
#endif
|
||||
if (ret >= 0) {
|
||||
//picture_pts = picture->best_effort_timestamp;
|
||||
if( picture_pts == AV_NOPTS_VALUE_ )
|
||||
picture_pts = picture->CV_FFMPEG_PTS_FIELD != AV_NOPTS_VALUE_ && picture->CV_FFMPEG_PTS_FIELD != 0 ? picture->CV_FFMPEG_PTS_FIELD : picture->pkt_dts;
|
||||
|
||||
valid = true;
|
||||
} else if (ret == AVERROR(EAGAIN)) {
|
||||
continue;
|
||||
@ -1526,8 +1522,11 @@ bool CvCapture_FFMPEG::grabFrame()
|
||||
}
|
||||
}
|
||||
|
||||
if (valid)
|
||||
if (valid) {
|
||||
if( picture_pts == AV_NOPTS_VALUE_ )
|
||||
picture_pts = picture->CV_FFMPEG_PTS_FIELD != AV_NOPTS_VALUE_ && picture->CV_FFMPEG_PTS_FIELD != 0 ? picture->CV_FFMPEG_PTS_FIELD : picture->pkt_dts;
|
||||
frame_number++;
|
||||
}
|
||||
|
||||
if (!rawMode && valid && first_frame_number < 0)
|
||||
first_frame_number = dts_to_frame_number(picture_pts);
|
||||
|
Loading…
Reference in New Issue
Block a user