diff mbox series

[FFmpeg-devel,10/10] avcodec/avcodec: Remove outdated comment

Message ID AM7PR03MB6660F5B9515C127D8B0AB3EE8F4B9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit ebf1d0f4bb7e849a4a4481eeba3a96c1df674308
Headers show
Series [FFmpeg-devel,01/10] avcodec/mpeg12dec: Don't set write-only variable | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 5, 2022, 9:56 p.m. UTC
avcodec_open2() is supposed to be thread-safe (those codecs
whose init functions are not thread-safe are guarded
by a global lock).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/avcodec.h | 2 --
 1 file changed, 2 deletions(-)

Comments

Marvin Scholz Jan. 5, 2022, 10:21 p.m. UTC | #1
On 5 Jan 2022, at 22:56, Andreas Rheinhardt wrote:

> avcodec_open2() is supposed to be thread-safe (those codecs
> whose init functions are not thread-safe are guarded
> by a global lock).
>

Maybe it would be better to note since which version this is
the case, or at least mention it in the api changelog?

> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/avcodec.h | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 7ee8bc2b7c..ec1a0566a4 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2384,8 +2384,6 @@ int avcodec_parameters_to_context(AVCodecContext 
> *codec,
>   * avcodec_find_decoder() and avcodec_find_encoder() provide an easy 
> way for
>   * retrieving a codec.
>   *
> - * @warning This function is not thread safe!
> - *
>   * @note Always call this function before using decoding routines 
> (such as
>   * @ref avcodec_receive_frame()).
>   *
> -- 
> 2.32.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Andreas Rheinhardt Jan. 6, 2022, 7:08 a.m. UTC | #2
Marvin Scholz:
> 
> 
> On 5 Jan 2022, at 22:56, Andreas Rheinhardt wrote:
> 
>> avcodec_open2() is supposed to be thread-safe (those codecs
>> whose init functions are not thread-safe are guarded
>> by a global lock).
>>
> 
> Maybe it would be better to note since which version this is
> the case, or at least mention it in the api changelog?
> 

There can be a data race with current git master if an mpeg4 decoder is
opened concurrently with an mpeg4-parser. This is fixed in patch #6 of
this patchset.
(Actually, avcodec_open2() is supposed to be thread-safe since the
introduction of the global lock, yet in practice there were several
issues with this; one of this is fixed in #6. Other issues were that the
AAC codecs claimed to be init-threadsafe, yet weren't for a long time
(see 195d8ce85eb73ff283f85dcee63383ec4081e3e7).)

>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>>  libavcodec/avcodec.h | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 7ee8bc2b7c..ec1a0566a4 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -2384,8 +2384,6 @@ int avcodec_parameters_to_context(AVCodecContext
>> *codec,
>>   * avcodec_find_decoder() and avcodec_find_encoder() provide an easy
>> way for
>>   * retrieving a codec.
>>   *
>> - * @warning This function is not thread safe!
>> - *
>>   * @note Always call this function before using decoding routines
>> (such as
>>   * @ref avcodec_receive_frame()).
>>   *
>> --
diff mbox series

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7ee8bc2b7c..ec1a0566a4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2384,8 +2384,6 @@  int avcodec_parameters_to_context(AVCodecContext *codec,
  * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
  * retrieving a codec.
  *
- * @warning This function is not thread safe!
- *
  * @note Always call this function before using decoding routines (such as
  * @ref avcodec_receive_frame()).
  *