diff options
Diffstat (limited to 'source/blender/imbuf/intern/indexer.c')
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index dcbce6d028c..33ff769217d 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -122,7 +122,8 @@ void IMB_index_builder_proc_frame(anim_index_builder * fp, e.pts = pts; fp->proc_frame(fp, buffer, data_size, &e); - } else { + } + else { IMB_index_builder_add_entry(fp, frameno, seek_pos, seek_pos_dts, pts); } @@ -138,7 +139,8 @@ void IMB_index_builder_finish(anim_index_builder * fp, int rollback) if (rollback) { unlink(fp->temp_name); - } else { + } + else { unlink(fp->name); BLI_rename(fp->temp_name, fp->name); } @@ -260,14 +262,16 @@ int IMB_indexer_get_frame_index(struct anim_index * idx, int frameno) first = middle; ++first; len = len - half - 1; - } else { + } + else { len = half; } } if (first == idx->num_entries) { return idx->num_entries - 1; - } else { + } + else { return first; } } @@ -361,7 +365,8 @@ static void get_index_dir(struct anim * anim, char * index_dir) BLI_splitdirstring(index_dir, fname); BLI_join_dirfile(index_dir, FILE_MAXDIR, index_dir, "BL_proxy"); BLI_join_dirfile(index_dir, FILE_MAXDIR, index_dir, fname); - } else { + } + else { BLI_strncpy(index_dir, anim->index_dir, FILE_MAXDIR); } } @@ -505,7 +510,8 @@ static struct proxy_output_ctx * alloc_proxy_output_ffmpeg( if (rv->codec->pix_fmts) { rv->c->pix_fmt = rv->codec->pix_fmts[0]; - } else { + } + else { rv->c->pix_fmt = PIX_FMT_YUVJ420P; } @@ -633,7 +639,8 @@ static int add_to_proxy_output_ffmpeg( } return 1; - } else { + } + else { return 0; } } @@ -686,7 +693,8 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx * ctx, if (rollback) { unlink(fname_tmp); - } else { + } + else { get_proxy_filename(ctx->anim, ctx->proxy_size, fname, FALSE); unlink(fname); @@ -731,7 +739,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim memset(context->proxy_ctx, 0, sizeof(context->proxy_ctx)); memset(context->indexer, 0, sizeof(context->indexer)); - if(av_open_input_file(&context->iFormatCtx, anim->name, NULL, 0, NULL) != 0) { + if (av_open_input_file(&context->iFormatCtx, anim->name, NULL, 0, NULL) != 0) { MEM_freeN(context); return NULL; } @@ -747,7 +755,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim /* Find the video stream */ context->videoStream = -1; for (i = 0; i < context->iFormatCtx->nb_streams; i++) - if(context->iFormatCtx->streams[i]->codec->codec_type + if (context->iFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (streamcount > 0) { streamcount--; @@ -919,7 +927,7 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, if (context->tcs_in_use & tc_types[i]) { int tc_frameno = frameno; - if(tc_types[i] == IMB_TC_RECORD_RUN_NO_GAPS) + if (tc_types[i] == IMB_TC_RECORD_RUN_NO_GAPS) tc_frameno = frameno_gapless; IMB_index_builder_proc_frame( @@ -1048,7 +1056,8 @@ static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context, if (stop) { unlink(fname_tmp); - } else { + } + else { unlink(fname); rename(fname_tmp, fname); } |