Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-01-11 02:08:16 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-01-11 02:27:53 +0300
commite041bf757944efee55a4a8bdc599c12bb8829863 (patch)
tree3d8ffa9ff6e49dfd548f6c0e5391c467e6ed128b
parent1dbaf0dbcca2c2756b2aa9f849334a5462739ddc (diff)
Cleanup: Use more meaningful constants other than 0
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index b0ab6f707fa..9994d479ce7 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -444,7 +444,7 @@ static void set_ffmpeg_property_option(AVCodecContext *c, IDProperty *prop, AVDi
param = strchr(name, ':');
if (param) {
- *param++ = 0;
+ *param++ = '\0';
}
switch (prop->type) {
@@ -1114,7 +1114,7 @@ static void ffmpeg_filepath_get(FFMpegContext *context, char *string, RenderData
BLI_make_existing_file(string);
- autosplit[0] = 0;
+ autosplit[0] = '\0';
if ((rd->ffcodecdata.flags & FFMPEG_AUTOSPLIT_OUTPUT) != 0) {
if (context) {
@@ -1137,7 +1137,7 @@ static void ffmpeg_filepath_get(FFMpegContext *context, char *string, RenderData
strcat(string, *exts);
}
else {
- *(string + strlen(string) - strlen(*fe)) = 0;
+ *(string + strlen(string) - strlen(*fe)) = '\0';
strcat(string, autosplit);
strcat(string, *fe);
}
@@ -1267,7 +1267,7 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit)
if (is_autosplit == false) {
if (context->audio_mixdown_device) {
AUD_Device_free(context->audio_mixdown_device);
- context->audio_mixdown_device = 0;
+ context->audio_mixdown_device = NULL;
}
}
#endif
@@ -1283,50 +1283,50 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit)
/* Close the video codec */
- if (context->video_stream && context->video_stream->codec) {
+ if (context->video_stream != NULL && context->video_stream->codec != NULL) {
avcodec_close(context->video_stream->codec);
PRINT("zero video stream %p\n", context->video_stream);
- context->video_stream = 0;
+ context->video_stream = NULL;
}
- if (context->audio_stream && context->audio_stream->codec) {
+ if (context->audio_stream != NULL && context->audio_stream->codec != NULL) {
avcodec_close(context->audio_stream->codec);
- context->audio_stream = 0;
+ context->audio_stream = NULL;
}
/* free the temp buffer */
- if (context->current_frame) {
+ if (context->current_frame != NULL) {
delete_picture(context->current_frame);
- context->current_frame = 0;
+ context->current_frame = NULL;
}
- if (context->outfile && context->outfile->oformat) {
+ if (context->outfile != NULL && context->outfile->oformat) {
if (!(context->outfile->oformat->flags & AVFMT_NOFILE)) {
avio_close(context->outfile->pb);
}
}
- if (context->outfile) {
+ if (context->outfile != NULL) {
avformat_free_context(context->outfile);
- context->outfile = 0;
+ context->outfile = NULL;
}
- if (context->audio_input_buffer) {
+ if (context->audio_input_buffer != NULL) {
av_free(context->audio_input_buffer);
- context->audio_input_buffer = 0;
+ context->audio_input_buffer = NULL;
}
#ifndef FFMPEG_HAVE_ENCODE_AUDIO2
- if (context->audio_output_buffer) {
+ if (context->audio_output_buffer != NULL) {
av_free(context->audio_output_buffer);
- context->audio_output_buffer = 0;
+ context->audio_output_buffer = NULL;
}
#endif
- if (context->audio_deinterleave_buffer) {
+ if (context->audio_deinterleave_buffer != NULL) {
av_free(context->audio_deinterleave_buffer);
- context->audio_deinterleave_buffer = 0;
+ context->audio_deinterleave_buffer = NULL;
}
- if (context->img_convert_ctx) {
+ if (context->img_convert_ctx != NULL) {
sws_freeContext(context->img_convert_ctx);
- context->img_convert_ctx = 0;
+ context->img_convert_ctx = NULL;
}
}
@@ -1425,8 +1425,8 @@ static IDProperty *BKE_ffmpeg_property_add(RenderData *rd, const char *type, con
int BKE_ffmpeg_property_add_string(RenderData *rd, const char *type, const char *str)
{
AVCodecContext c;
- const AVOption *o = 0;
- const AVOption *p = 0;
+ const AVOption *o = NULL;
+ const AVOption *p = NULL;
char name_[128];
char *name;
char *param;
@@ -1445,7 +1445,7 @@ int BKE_ffmpeg_property_add_string(RenderData *rd, const char *type, const char
param = strchr(name, ' ');
}
if (param) {
- *param++ = 0;
+ *param++ = '\0';
while (*param == ' ') param++;
}