diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-15 20:33:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-15 21:00:50 +0200 |
commit | fb33bff990a8327f59d4c7c509bba1f62bbd6c5a (patch) | |
tree | c6f3ad232bed67c703999d78b3fcff66daa8c91d /libavcodec/mpegvideo.c | |
parent | 3bb22973518cbef28504e4d5b9fd74453cc3339c (diff) | |
parent | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 (diff) | |
download | ffmpeg-fb33bff990a8327f59d4c7c509bba1f62bbd6c5a.tar.gz |
Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'
* commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39':
cosmetics: Write NULL pointer equality checks more compactly
Conflicts:
cmdutils.c
ffmpeg_opt.c
ffplay.c
libavcodec/dvbsub.c
libavcodec/dvdsubdec.c
libavcodec/dvdsubenc.c
libavcodec/dxa.c
libavcodec/libxvid_rc.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo_enc.c
libavcodec/rv10.c
libavcodec/tiffenc.c
libavcodec/utils.c
libavcodec/vc1dec.c
libavcodec/zmbv.c
libavdevice/v4l2.c
libavformat/matroskadec.c
libavformat/movenc.c
libavformat/sdp.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 119aae2e82..ed4ca3561d 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -870,7 +870,7 @@ fail: static void free_duplicate_context(MpegEncContext *s) { - if (s == NULL) + if (!s) return; av_freep(&s->edge_emu_buffer); @@ -1671,7 +1671,7 @@ static inline int pic_is_unused(MpegEncContext *s, Picture *pic) { if (pic == s->last_picture_ptr) return 0; - if (pic->f->buf[0] == NULL) + if (!pic->f->buf[0]) return 1; if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF)) return 1; @@ -1684,7 +1684,7 @@ static int find_unused_picture(MpegEncContext *s, int shared) if (shared) { for (i = 0; i < MAX_PICTURE_COUNT; i++) { - if (s->picture[i].f->buf[0] == NULL && &s->picture[i] != s->last_picture_ptr) + if (!s->picture[i].f->buf[0] && &s->picture[i] != s->last_picture_ptr) return i; } } else { @@ -1780,8 +1780,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) release_unused_pictures(s); - if (s->current_picture_ptr && - s->current_picture_ptr->f->buf[0] == NULL) { + if (s->current_picture_ptr && !s->current_picture_ptr->f->buf[0]) { // we already have a unused image // (maybe it was set before reading the header) pic = s->current_picture_ptr; @@ -1839,8 +1838,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) s->current_picture_ptr ? s->current_picture_ptr->f->data[0] : NULL, s->pict_type, s->droppable); - if ((s->last_picture_ptr == NULL || - s->last_picture_ptr->f->buf[0] == NULL) && + if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && (s->pict_type != AV_PICTURE_TYPE_I || s->picture_structure != PICT_FRAME)) { int h_chroma_shift, v_chroma_shift; @@ -1893,8 +1891,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0); ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 1); } - if ((s->next_picture_ptr == NULL || - s->next_picture_ptr->f->buf[0] == NULL) && + if ((!s->next_picture_ptr || !s->next_picture_ptr->f->buf[0]) && s->pict_type == AV_PICTURE_TYPE_B) { /* Allocate a dummy frame */ i = ff_find_unused_picture(s, 0); @@ -3240,7 +3237,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){ int i; MpegEncContext *s = avctx->priv_data; - if(s==NULL || s->picture==NULL) + if (!s || !s->picture) return; for (i = 0; i < MAX_PICTURE_COUNT; i++) |