diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-01-29 18:34:48 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2020-02-07 19:36:57 +0300 |
commit | af1f1e8665414f37bd64c8f6878b808055abb0be (patch) | |
tree | d6bc7fe2940af720e2f1d1ef0368c67221569ec1 /libavcodec/ac3enc.c | |
parent | 2b61c908b1a17553fa2542d7b3880d6be8618750 (diff) |
ac3enc: drop a global variable
Log the warning message once per encoder instance instead.
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r-- | libavcodec/ac3enc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 25318f8631..7ce17db067 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1993,12 +1993,11 @@ int ff_ac3_validate_metadata(AC3EncodeContext *s) /* set bitstream id for alternate bitstream syntax */ if (!s->eac3 && (opt->extended_bsi_1 || opt->extended_bsi_2)) { if (s->bitstream_id > 8 && s->bitstream_id < 11) { - static int warn_once = 1; - if (warn_once) { + if (!s->warned_alternate_bitstream) { av_log(avctx, AV_LOG_WARNING, "alternate bitstream syntax is " "not compatible with reduced samplerates. writing of " "extended bitstream information will be disabled.\n"); - warn_once = 0; + s->warned_alternate_bitstream = 1; } } else { s->bitstream_id = 6; |