diff mbox series

[FFmpeg-devel,2/6] avcodec:v4l2_context: Remove NULL initialization

Message ID 20200113041130.30126-2-andriy.gelman@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/6] doc/v4l2_m2m: Add documentation | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andriy Gelman Jan. 13, 2020, 4:11 a.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavcodec/v4l2_context.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Mark Thompson Feb. 1, 2020, 9:44 p.m. UTC | #1
On 13/01/2020 04:11, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
>  libavcodec/v4l2_context.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
On 13/01/2020 04:11, Andriy Gelman wrote:> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> Before this commit s->avctx == NULL was used to infer that an encoder is
> being initialzed. Code readability has been improved by directly using
> !av_codec_is_decoder() instead.
> 
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
>  libavcodec/v4l2_m2m.c     | 4 ++--
>  libavcodec/v4l2_m2m_enc.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
On 13/01/2020 04:11, Andriy Gelman wrote:> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> Before this commit v4l2_m2m used two different logging contexts (from
> V4L2m2mPriv and AVCodecContext). For consistency always use AVCodecContext.
> 
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
>  libavcodec/v4l2_context.c |  2 +-
>  libavcodec/v4l2_m2m.c     | 18 +++++++++---------
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
On 13/01/2020 04:11, Andriy Gelman wrote:> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> Change pointer symbol position.
> 
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
>  libavcodec/v4l2_m2m.c     | 10 +++++-----
>  libavcodec/v4l2_m2m_dec.c |  2 +-
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 

All four of these LGTM.  I did a little bit of testing and applied.

Thanks,

- Mark
diff mbox series

Patch

diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
index bdc2b841530..d38ff732dbf 100644
--- a/libavcodec/v4l2_context.c
+++ b/libavcodec/v4l2_context.c
@@ -278,7 +278,7 @@  static V4L2Buffer* v4l2_dequeue_v4l2buf(V4L2Context *ctx, int timeout)
 {
     struct v4l2_plane planes[VIDEO_MAX_PLANES];
     struct v4l2_buffer buf = { 0 };
-    V4L2Buffer* avbuf = NULL;
+    V4L2Buffer* avbuf;
     struct pollfd pfd = {
         .events =  POLLIN | POLLRDNORM | POLLPRI | POLLOUT | POLLWRNORM, /* default blocking capture */
         .fd = ctx_to_m2mctx(ctx)->fd,
@@ -604,7 +604,7 @@  int ff_v4l2_context_enqueue_packet(V4L2Context* ctx, const AVPacket* pkt)
 
 int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* frame, int timeout)
 {
-    V4L2Buffer* avbuf = NULL;
+    V4L2Buffer* avbuf;
 
     /*
      * timeout=-1 blocks until:
@@ -624,7 +624,7 @@  int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* frame, int timeout)
 
 int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt)
 {
-    V4L2Buffer* avbuf = NULL;
+    V4L2Buffer* avbuf;
 
     /*
      * blocks until: