Fix a regression introduced by https://developer.blender.org/D1396 on video playing
Fix a regression introduced by https://developer.blender.org/D1396 on video playing Look at @mariomey example file. Reviewers: panzergame Subscribers: mariomey Projects: #game_engine Differential Revision: https://developer.blender.org/D1623
This commit is contained in:
parent
96cff85610
commit
34f51cd498
|
@ -1024,11 +1024,11 @@ AVFrame *VideoFFmpeg::grabFrame(long position)
|
|||
AVFrame *input = m_frame;
|
||||
short counter = 0;
|
||||
|
||||
/* While the data is not read properly (png, tiffs, etc formats may need several pass)*/
|
||||
while ((input->data[0] == 0 && input->data[1] == 0 && input->data[2] == 0 && input->data[3] == 0) && counter < 10) {
|
||||
/* If m_isImage, while the data is not read properly (png, tiffs, etc formats may need several pass), else don't need while loop*/
|
||||
do {
|
||||
avcodec_decode_video2(m_codecCtx, m_frame, &frameFinished, &packet);
|
||||
counter++;
|
||||
}
|
||||
} while ((input->data[0] == 0 && input->data[1] == 0 && input->data[2] == 0 && input->data[3] == 0) && counter < 10 && m_isImage);
|
||||
|
||||
// remember dts to compute exact frame number
|
||||
dts = packet.dts;
|
||||
|
|
Loading…
Reference in New Issue