diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 11:52:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 11:52:14 +0400 |
commit | b8a71efeba70d6c3ebc579f5043daa4162da86e8 (patch) | |
tree | d2d89da2a59f8955583f4968a35e48c578fd4d4c /source/gameengine/VideoTexture | |
parent | 81d8f17843f92c6d6abbacb652ca22917910f4bc (diff) |
style cleanup: follow style guide for/with/if spacing
Diffstat (limited to 'source/gameengine/VideoTexture')
-rw-r--r-- | source/gameengine/VideoTexture/ImageRender.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/VideoFFmpeg.cpp | 22 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/blendVideoTex.cpp | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 3718a7b3094..9f7d42dcf56 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -459,7 +459,7 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds else THRWEXCP(SceneInvalid, S_OK); - if(scenePtr==NULL) /* in case the python proxy reference is invalid */ + if (scenePtr==NULL) /* in case the python proxy reference is invalid */ THRWEXCP(SceneInvalid, S_OK); // get observer pointer @@ -471,7 +471,7 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds else THRWEXCP(ObserverInvalid, S_OK); - if(observerPtr==NULL) /* in case the python proxy reference is invalid */ + if (observerPtr==NULL) /* in case the python proxy reference is invalid */ THRWEXCP(ObserverInvalid, S_OK); // get mirror pointer @@ -481,7 +481,7 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds else THRWEXCP(MirrorInvalid, S_OK); - if(mirrorPtr==NULL) /* in case the python proxy reference is invalid */ + if (mirrorPtr==NULL) /* in case the python proxy reference is invalid */ THRWEXCP(MirrorInvalid, S_OK); // locate the material in the mirror diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 9db85a0029a..427be39ef22 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -169,10 +169,10 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV AVCodec *codec; AVCodecContext *codecCtx; - if(av_open_input_file(&formatCtx, filename, inputFormat, 0, formatParams)!=0) + if (av_open_input_file(&formatCtx, filename, inputFormat, 0, formatParams)!=0) return -1; - if(av_find_stream_info(formatCtx)<0) + if (av_find_stream_info(formatCtx)<0) { av_close_input_file(formatCtx); return -1; @@ -180,9 +180,9 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV /* Find the first video stream */ videoStream=-1; - for(i=0; i<formatCtx->nb_streams; i++) + for (i=0; i<formatCtx->nb_streams; i++) { - if(formatCtx->streams[i] && + if (formatCtx->streams[i] && get_codec_from_stream(formatCtx->streams[i]) && (get_codec_from_stream(formatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO)) { @@ -191,7 +191,7 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV } } - if(videoStream==-1) + if (videoStream==-1) { av_close_input_file(formatCtx); return -1; @@ -201,20 +201,20 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV /* Find the decoder for the video stream */ codec=avcodec_find_decoder(codecCtx->codec_id); - if(codec==NULL) + if (codec==NULL) { av_close_input_file(formatCtx); return -1; } codecCtx->workaround_bugs = 1; - if(avcodec_open(codecCtx, codec)<0) + if (avcodec_open(codecCtx, codec)<0) { av_close_input_file(formatCtx); return -1; } #ifdef FFMPEG_OLD_FRAME_RATE - if(codecCtx->frame_rate>1000 && codecCtx->frame_rate_base==1) + if (codecCtx->frame_rate>1000 && codecCtx->frame_rate_base==1) codecCtx->frame_rate_base=1000; m_baseFrameRate = (double)codecCtx->frame_rate / (double)codecCtx->frame_rate_base; #else @@ -373,7 +373,7 @@ void *VideoFFmpeg::cacheThread(void *data) avcodec_decode_video2(video->m_codecCtx, video->m_frame, &frameFinished, &cachePacket->packet); - if(frameFinished) + if (frameFinished) { AVFrame * input = video->m_frame; @@ -793,7 +793,7 @@ void VideoFFmpeg::calcImage (unsigned int texId, double ts) { AVFrame* frame; // get image - if((frame = grabFrame(actFrame)) != NULL) + if ((frame = grabFrame(actFrame)) != NULL) { if (!m_isFile && !m_cacheStarted) { @@ -999,7 +999,7 @@ AVFrame *VideoFFmpeg::grabFrame(long position) // return the next frame. This is not quite correct, may need more work while(av_read_frame(m_formatCtx, &packet)>=0) { - if(packet.stream_index == m_videoStream) + if (packet.stream_index == m_videoStream) { avcodec_decode_video2(m_codecCtx, m_frame, &frameFinished, diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index 8410e9350d0..a82935c30bf 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -189,7 +189,7 @@ PyObject* initVideoTexture(void) /* Use existing module where possible * be careful not to init any runtime vars after this */ m = PyImport_ImportModule( "VideoTexture" ); - if(m) { + if (m) { Py_DECREF(m); return m; } |