diff mbox

[FFmpeg-devel,1/2] avcodec/v4l2_m2m_dec: Fix decoding on Odroid XU4

Message ID 20191112053703.22782-1-andriy.gelman@gmail.com
State Accepted
Commit ccc83ff11e071939acc198f118b1e5dd86fd9a42
Headers show

Commit Message

Andriy Gelman Nov. 12, 2019, 5:37 a.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

c0c79461967 unintentianally changed the initialization flow of the
decoder: It caused the capture buffers to be initialized on
v4l2_m2m.c:180 in v4l2_configure_contexts(). This breaks h264 decoding
on the Odroid XU4 (RPI4 was not affected).

This commit postpones capture buffer initialization
as before c0c79461967 to fix the issue.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavcodec/v4l2_m2m_dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Aman Karmani Nov. 22, 2019, 8:08 p.m. UTC | #1
On Mon, Nov 11, 2019 at 9:44 PM Andriy Gelman <andriy.gelman@gmail.com>
wrote:

> From: Andriy Gelman <andriy.gelman@gmail.com>
>
> c0c79461967 unintentianally changed the initialization flow of the
> decoder: It caused the capture buffers to be initialized on
> v4l2_m2m.c:180 in v4l2_configure_contexts(). This breaks h264 decoding
> on the Odroid XU4 (RPI4 was not affected).
>

Thanks for catching this and for the patch to fix.

Applied to master.

Aman


>
> This commit postpones capture buffer initialization
> as before c0c79461967 to fix the issue.
>
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
>  libavcodec/v4l2_m2m_dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
> index 4712aca34c2..83d506b6b09 100644
> --- a/libavcodec/v4l2_m2m_dec.c
> +++ b/libavcodec/v4l2_m2m_dec.c
> @@ -201,6 +201,7 @@ static av_cold int v4l2_decode_init(AVCodecContext
> *avctx)
>      capture->av_codec_id = AV_CODEC_ID_RAWVIDEO;
>      capture->av_pix_fmt = avctx->pix_fmt;
>
> +    s->avctx = avctx;
>      ret = ff_v4l2_m2m_codec_init(priv);
>      if (ret) {
>          av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
> @@ -209,7 +210,6 @@ static av_cold int v4l2_decode_init(AVCodecContext
> *avctx)
>
>          return ret;
>      }
> -    s->avctx = avctx;
>
>      return v4l2_prepare_decoder(s);
>  }
> --
> 2.23.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox

Patch

diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index 4712aca34c2..83d506b6b09 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -201,6 +201,7 @@  static av_cold int v4l2_decode_init(AVCodecContext *avctx)
     capture->av_codec_id = AV_CODEC_ID_RAWVIDEO;
     capture->av_pix_fmt = avctx->pix_fmt;
 
+    s->avctx = avctx;
     ret = ff_v4l2_m2m_codec_init(priv);
     if (ret) {
         av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
@@ -209,7 +210,6 @@  static av_cold int v4l2_decode_init(AVCodecContext *avctx)
 
         return ret;
     }
-    s->avctx = avctx;
 
     return v4l2_prepare_decoder(s);
 }