diff options
author | Diego Biurrun <diego@biurrun.de> | 2009-10-20 02:26:52 +0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2009-10-20 02:26:52 +0400 |
commit | 96ff02f1b4f382936b9e212a98d80d0b92d5058c (patch) | |
tree | f2b40b08679d9b1bf3eb95483048c80e40d9dd39 /libavcodec/libtheoraenc.c | |
parent | 6f571d89c1cfafcf25c95202eb7e44452fc612d7 (diff) |
Get rid of some pointless '== NULL' / '!= 0' conditions in if statements.
Originally committed as revision 20325 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/libtheoraenc.c')
-rw-r--r-- | libavcodec/libtheoraenc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index 288727fd84..c154cbd05a 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -61,10 +61,10 @@ static int concatenate_packet(unsigned int* offset, message = "extradata_size would overflow"; } else { newdata = av_realloc(avc_context->extradata, newsize); - if (newdata == NULL) + if (!newdata) message = "av_realloc failed"; } - if (message != NULL) { + if (message) { av_log(avc_context, AV_LOG_ERROR, "concatenate_packet failed: %s\n", message); return -1; } @@ -98,7 +98,7 @@ static av_cold int encode_init(AVCodecContext* avc_context) * time period between frames, but theora_info needs the framerate. */ t_info.fps_numerator = avc_context->time_base.den; t_info.fps_denominator = avc_context->time_base.num; - if (avc_context->sample_aspect_ratio.num != 0) { + if (avc_context->sample_aspect_ratio.num) { t_info.aspect_numerator = avc_context->sample_aspect_ratio.num; t_info.aspect_denominator = avc_context->sample_aspect_ratio.den; } else { @@ -133,7 +133,7 @@ static av_cold int encode_init(AVCodecContext* avc_context) } /* Now initialise libtheora */ - if (theora_encode_init(&(h->t_state), &t_info) != 0) { + if (theora_encode_init(&(h->t_state), &t_info)) { av_log(avc_context, AV_LOG_ERROR, "theora_encode_init failed\n"); return -1; } @@ -152,13 +152,13 @@ static av_cold int encode_init(AVCodecContext* avc_context) /* Header */ theora_encode_header(&(h->t_state), &o_packet); - if (concatenate_packet(&offset, avc_context, &o_packet) != 0) + if (concatenate_packet(&offset, avc_context, &o_packet)) return -1; /* Comment */ theora_comment_init(&t_comment); theora_encode_comment(&t_comment, &o_packet); - if (concatenate_packet(&offset, avc_context, &o_packet) != 0) + if (concatenate_packet(&offset, avc_context, &o_packet)) return -1; /* Clear up theora_comment struct before we reset the packet */ theora_comment_clear(&t_comment); @@ -168,7 +168,7 @@ static av_cold int encode_init(AVCodecContext* avc_context) /* Tables */ theora_encode_tables(&(h->t_state), &o_packet); - if (concatenate_packet(&offset, avc_context, &o_packet) != 0) + if (concatenate_packet(&offset, avc_context, &o_packet)) return -1; /* Set up the output AVFrame */ @@ -207,7 +207,7 @@ static int encode_frame(AVCodecContext* avc_context, uint8_t *outbuf, /* Now call into theora_encode_YUVin */ result = theora_encode_YUVin(&(h->t_state), &t_yuv_buffer); - if (result != 0) { + if (result) { const char* message; switch (result) { case -1: |