diff options
author | Ulysse Martin <you.le@live.fr> | 2015-11-28 16:55:38 +0300 |
---|---|---|
committer | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-11-28 16:56:22 +0300 |
commit | 34f51cd4983db8d47ac41f949e466a520fa2173d (patch) | |
tree | 622844161fae2e45e02fa1416b42919e4c5c9c01 /source/gameengine/VideoTexture | |
parent | 96cff85610d9d3a6ec8b204bb69f3ab146843497 (diff) |
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
Diffstat (limited to 'source/gameengine/VideoTexture')
-rw-r--r-- | source/gameengine/VideoTexture/VideoFFmpeg.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 9585d8b0138..3bf11fbdfd6 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -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; |