1. 03 Apr, 2017 6 commits
    • Ronald S. Bultje's avatar
      pthread_frame: call update_context_from_user() after acquiring lock. · 1269cd5b
      Ronald S. Bultje authored
      Otherwise the thread may still be in the middle of decoding a previous
      frame, which would effectively trigger a race condition on any field
      concurrently read and written.
      
      In practice, this fixes tsan warnings like the following:
      
      WARNING: ThreadSanitizer: data race (pid=17380)
        Write of size 4 at 0x7d64000160fc by main thread:
          #0 update_context_from_user src/libavcodec/pthread_frame.c:335 (ffmpeg+0x000000dca515)
      [..]
        Previous read of size 4 at 0x7d64000160fc by thread T2 (mutexes: write M1821):
          #0 ff_thread_report_progress src/libavcodec/pthread_frame.c:565 (ffmpeg+0x000000dcb08a)
      1269cd5b
    • Ronald S. Bultje's avatar
      ffmpeg: make transcode_init_done atomic. · 76d8c774
      Ronald S. Bultje authored
      Should fix tsan warnings in fate-fifo-muxer-h264/wav:
      
      WARNING: ThreadSanitizer: data race (pid=26552)
        Write of size 4 at 0x000001e0d7c0 by main thread:
          #0 transcode_init src/ffmpeg.c:3761 (ffmpeg+0x00000050ca1c)
      [..]
        Previous read of size 4 at 0x000001e0d7c0 by thread T1:
          #0 decode_interrupt_cb src/ffmpeg.c:460 (ffmpeg+0x0000004fde19)
      76d8c774
    • Ronald S. Bultje's avatar
      codec_desc: mark some lossless audio codecs as intraonly. · 467a0538
      Ronald S. Bultje authored
      Fixes tsan warnings in several audio codecs (flac, alac, wavpack, tta
      and tak) that look like this:
      
      WARNING: ThreadSanitizer: data race (pid=14340)
        Read of size 4 at 0x7d64000169d8 by main thread (mutexes: write M1335):
          #0 update_context_from_thread src/libavcodec/pthread_frame.c:284 (ffmpeg+0x000000dc795f)
      [..]
        Previous write of size 4 at 0x7d64000169d8 by thread T1 (mutexes: write M1333):
          #0 wavpack_decode_block src/libavcodec/wavpack.c:1012 (ffmpeg+0x00000112b175)
      467a0538
    • Ronald S. Bultje's avatar
      h264: don't sync pic_id between threads. · e72690b1
      Ronald S. Bultje authored
      This is how the ref list manager links bitstream IDs to H264Picture/Ref
      objects, and is local to the producer thread. There is no need for the
      consumer thread to know the bitstream IDs of its references in their
      respective producer threads.
      
      In practice, this fixes tsan warnings when running fate-h264:
      
      WARNING: ThreadSanitizer: data race (pid=19295)
        Read of size 4 at 0x7dbc0000e614 by main thread (mutexes: write M1914):
          #0 ff_h264_ref_picture src/libavcodec/h264_picture.c:112 (ffmpeg+0x0000013b3709)
      [..]
        Previous write of size 4 at 0x7dbc0000e614 by thread T2 (mutexes: write M1917):
          #0 build_def_list src/libavcodec/h264_refs.c:91 (ffmpeg+0x0000013b46cf)
      e72690b1
    • Martin Vignali's avatar
    • Martin Vignali's avatar
  2. 02 Apr, 2017 8 commits
  3. 01 Apr, 2017 26 commits