[FFmpeg-devel] avcodec/vaapi_h264: skip decode if pic has no slices

Peter F peter.fruehberger at gmail.com
Sat Mar 9 14:21:33 EET 2019


>From 816e9156235a5d7d895b09c0235c9f8f1f7703e7 Mon Sep 17 00:00:00 2001
From: xbmc <fernetmenta at online.de>
Date: Sat, 26 Jan 2019 19:48:35 +0100
Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices

---
 libavcodec/vaapi_h264.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index 5854587a25..81a46fa747 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
     H264SliceContext *sl = &h->slice_ctx[0];
     int ret;

+    if (pic->nb_slices == 0) {
+        ret = -1;
+        goto finish;
+    }
+
     ret = ff_vaapi_decode_issue(avctx, pic);
     if (ret < 0)
         goto finish;
-- 
2.19.1


Am Sa., 9. März 2019 um 12:46 Uhr schrieb Peter F <peter.fruehberger at gmail.com>:
>
> Fixes / workarounds: https://bugs.freedesktop.org/show_bug.cgi?id=105368 [1]in ffmpeg
> This bug hits several AMD VAAPI users, especially those using h264 channels via DVB-X: https://github.com/xbmc/xbmc/issues/15704
>
> Typical backtrace in ffmpeg code, which fits the description in [1]:
>
> #0  __memset_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:186
> #1  0x00007ff39a9607b4 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
> #2  0x00007ff39a6bf6a1 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
> #3  0x00007ff3d1763820 in vaEndPicture () from /usr/lib/x86_64-linux-gnu/libva.so.2
> #4  0x000055cd92b3655a in ff_vaapi_decode_issue ()
> #5  0x000055cd926dc8e1 in ?? ()
> #6  0x000055cd92a4975c in ff_h264_field_end ()
> #7  0x000055cd92455ca1 in ?? ()
> #8  0x000055cd923a3727 in ?? ()
> #9  0x000055cd923a6448 in avcodec_send_packet ()
>
>
>
> --
>                    Key-ID:     0x1A995A9B
>                    keyserver: pgp.mit.edu
> ==============================================================
> Fingerprint: 4606 DA19 EC2E 9A0B 0157  C81B DA07 CF63 1A99 5A9B



-- 
                   Key-ID:     0x1A995A9B
                   keyserver: pgp.mit.edu
==============================================================
Fingerprint: 4606 DA19 EC2E 9A0B 0157  C81B DA07 CF63 1A99 5A9B


More information about the ffmpeg-devel mailing list