1. 27 Nov, 2014 3 commits
    • wm4's avatar
      lavu: fix memory leaks by using a mutex instead of atomics · fbd6c97f
      wm4 authored
      The buffer pool has to atomically add and remove entries from the linked
      list of available buffers. This was done by removing the entire list
      with a CAS operation, working on it, and then setting it back again
      (using a retry-loop in case another thread was doing the same thing).
      
      This could effectively cause memory leaks: while a thread was working on
      the buffer list, other threads would allocate new buffers, increasing
      the pool's total size. There was no real leak, but since these extra
      buffers were not needed, but not free'd either (except when the buffer
      pool was destroyed), this had the same effects as a real leak. For some
      reason, growth was exponential, and could easily kill the process due
      to OOM in real-world uses.
      
      Fix this by using a mutex to protect the list operations. The fancy
      way atomics remove the whole list to work on it is not needed anymore,
      which also avoids the situation which was causing the leak.
      Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
      fbd6c97f
    • Anton Khirnov's avatar
      lavu: add wrappers for the pthreads mutex API · 2443e522
      Anton Khirnov authored
      Also add no-op fallbacks when threading is disabled.
      
      This helps keeping the code clean if Libav is compiled for targets
      without threading. Since we assume that no threads of any kind are used
      in such configurations, doing nothing is ok by definition.
      
      Based on a patch by wm4 <nfxjfg@googlemail.com>.
      2443e522
    • Martin Storsjö's avatar
      Share the utf8 to wchar conversion routine between lavf and lavu · 9326d64e
      Martin Storsjö authored
      This doesn't add any dependency on library internals, since this
      only is a static inline function that gets built into each of the
      calling functions - this is only to reduce the code duplication.
      Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
      9326d64e
  2. 24 Nov, 2014 1 commit
  3. 11 Nov, 2014 1 commit
  4. 07 Nov, 2014 1 commit
  5. 25 Oct, 2014 2 commits
  6. 24 Oct, 2014 1 commit
    • Martin Storsjö's avatar
      lavu: Add av_gettime_relative · 1bd0bdcd
      Martin Storsjö authored
      Since av_gettime() is used in a number of places where actual
      real time clock is required, the monotonic clock introduced in
      ebef9f5a would have consequences that are hard to handle. Instead
      split it into a separate function that can be used in the cases
      where only relative time is desired.
      
      On platform where no monotonic clock is available, the difference
      between the two av_gettime functions is not clear, and one could
      mistakenly use the relative clock where an absolute one is
      required. Therefore add an offset, to make it evident that the
      time returned from av_gettime_relative never is actual current
      real time, even though it is based on av_gettime.
      
      Based on a patch by Olivier Langlois.
      Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
      1bd0bdcd
  7. 08 Oct, 2014 3 commits
  8. 26 Sep, 2014 1 commit
  9. 09 Sep, 2014 3 commits
  10. 08 Sep, 2014 1 commit
  11. 03 Sep, 2014 2 commits
  12. 15 Aug, 2014 3 commits
  13. 14 Aug, 2014 1 commit
  14. 13 Aug, 2014 4 commits
  15. 10 Aug, 2014 1 commit
  16. 09 Aug, 2014 3 commits
  17. 04 Aug, 2014 5 commits
  18. 03 Aug, 2014 4 commits