[FFmpeg-cvslog] h264: don't re-call ff_h264_direct_ref_list_init() w/ frame-mt.

Ronald S. Bultje git at videolan.org
Thu Apr 13 03:30:39 EEST 2017


ffmpeg | branch: release/3.3 | Ronald S. Bultje <rsbultje at gmail.com> | Thu Apr  6 11:47:03 2017 -0400| [414d11fff6453b3d3af75734292f8d16edeba940] | committer: Michael Niedermayer

h264: don't re-call ff_h264_direct_ref_list_init() w/ frame-mt.

I'm hoping that this will address the remaining tsan fate-h264 issues:

WARNING: ThreadSanitizer: data race (pid=24478)
  Read of size 8 at 0x7dbc0001c828 by main thread (mutexes: write M3243):
    #0 ff_h264_ref_picture src/libavcodec/h264_picture.c:107 (ffmpeg+0x0000013b78d8)
[..]
  Previous write of size 1 at 0x7dbc0001c82e by thread T2 (mutexes: write M3245):
    #0 ff_h264_direct_ref_list_init src/libavcodec/h264_direct.c:137 (ffmpeg+0x000001382c93)

But I'm not sure because I haven't been able to reproduce locally.

(cherry picked from commit 7f05c5cea04112471d8147487aa3b44141922d09)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=414d11fff6453b3d3af75734292f8d16edeba940
---

 libavcodec/h264_slice.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 44a0b9fb17..70ad05f640 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1889,7 +1889,8 @@ static int h264_slice_init(H264Context *h, H264SliceContext *sl,
 
     if (sl->slice_type_nos == AV_PICTURE_TYPE_B && !sl->direct_spatial_mv_pred)
         ff_h264_direct_dist_scale_factor(h, sl);
-    ff_h264_direct_ref_list_init(h, sl);
+    if (!h->setup_finished)
+        ff_h264_direct_ref_list_init(h, sl);
 
     if (h->avctx->skip_loop_filter >= AVDISCARD_ALL ||
         (h->avctx->skip_loop_filter >= AVDISCARD_NONKEY &&



More information about the ffmpeg-cvslog mailing list