[libav-bugs] [Bug 968] New: Docs stating avcodec_open2 is not thread-safe are lying.

bugzilla at libav.org bugzilla at libav.org
Sun Oct 9 03:08:05 CEST 2016


            Bug ID: 968
           Summary: Docs stating avcodec_open2 is not thread-safe are
           Product: Libav
           Version: 11
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: ---
         Component: libavcodec
          Assignee: bugzilla at libav.org
          Reporter: jason.cipriani at gmail.com

the documentation for avcodec_open2 states:

  Warning: This function is not thread-safe!

Problem 1: This is a lie. The source, for 11.7 at least, contains a proper call
to the lock manager's obtain/release commands in libavcodec\utils.c. So, it is
thread-safe with a properly functioning lock manager.

Problem 2: This is inconsistent with the rest of the documentation, as none of
the functions that call avcodec_open2 (for example, avformat_find_stream_info)
contain this warning in documentation. If this function truly weren't
thread-safe, a lot of folks would have been caught off-guard. This is why I
investigated it to begin with.

I've marked this as major for three reasons:

1. The amount of personal time lost trying to figure out the nature of that
warning, which wasn't fun on top of all the other issues slogging through this

2. I'm not the only person to be confused by this:

3. A client implementation can be significantly misguided and over-complicated
if this warning is taken to heart and not confirmed ahead of time.

4. Documentation is important.

Suggested fix: Not only should the warning be removed, but it should be
replaced with a note that says the opposite to clear up any legacy doubt.

I am using 11.7 since that is the latest Windows binary build.


You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-bugs/attachments/20161009/4179a768/attachment.html>

More information about the libav-bugs mailing list