Commit 467a0538 authored by Ronald S. Bultje's avatar Ronald S. Bultje

codec_desc: mark some lossless audio codecs as intraonly.

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)
parent e72690b1
...@@ -724,7 +724,7 @@ typedef struct AVCodecDescriptor { ...@@ -724,7 +724,7 @@ typedef struct AVCodecDescriptor {
/** /**
* Codec uses only intra compression. * Codec uses only intra compression.
* Video codecs only. * Video and audio codecs only.
*/ */
#define AV_CODEC_PROP_INTRA_ONLY (1 << 0) #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
/** /**
......
...@@ -2313,7 +2313,7 @@ static const AVCodecDescriptor codec_descriptors[] = { ...@@ -2313,7 +2313,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.name = "flac", .name = "flac",
.long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
.props = AV_CODEC_PROP_LOSSLESS, .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
}, },
{ {
.id = AV_CODEC_ID_MP3ADU, .id = AV_CODEC_ID_MP3ADU,
...@@ -2341,7 +2341,7 @@ static const AVCodecDescriptor codec_descriptors[] = { ...@@ -2341,7 +2341,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.name = "alac", .name = "alac",
.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
.props = AV_CODEC_PROP_LOSSLESS, .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
}, },
{ {
.id = AV_CODEC_ID_WESTWOOD_SND1, .id = AV_CODEC_ID_WESTWOOD_SND1,
...@@ -2383,7 +2383,7 @@ static const AVCodecDescriptor codec_descriptors[] = { ...@@ -2383,7 +2383,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.name = "tta", .name = "tta",
.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
.props = AV_CODEC_PROP_LOSSLESS, .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
}, },
{ {
.id = AV_CODEC_ID_SMACKAUDIO, .id = AV_CODEC_ID_SMACKAUDIO,
...@@ -2404,7 +2404,8 @@ static const AVCodecDescriptor codec_descriptors[] = { ...@@ -2404,7 +2404,8 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.name = "wavpack", .name = "wavpack",
.long_name = NULL_IF_CONFIG_SMALL("WavPack"), .long_name = NULL_IF_CONFIG_SMALL("WavPack"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS, .props = AV_CODEC_PROP_INTRA_ONLY |
AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
}, },
{ {
.id = AV_CODEC_ID_DSICINAUDIO, .id = AV_CODEC_ID_DSICINAUDIO,
...@@ -2712,7 +2713,7 @@ static const AVCodecDescriptor codec_descriptors[] = { ...@@ -2712,7 +2713,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.name = "tak", .name = "tak",
.long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"), .long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"),
.props = AV_CODEC_PROP_LOSSLESS, .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
}, },
{ {
.id = AV_CODEC_ID_METASOUND, .id = AV_CODEC_ID_METASOUND,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment