style cleanup: follow style guide for/with/if spacing

This commit is contained in:
2012-03-24 07:52:14 +00:00
parent 81d8f17843
commit b8a71efeba
213 changed files with 2407 additions and 2406 deletions

View File

@@ -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,