summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12enc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-22 17:10:12 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-04 16:28:55 +0100
commitac49439e7734f384206b77ab6860d74f5969c281 (patch)
tree9b30970f33302c05067a9e19f7db570d27cdbd07 /libavcodec/mpeg12enc.c
parent7a2f7283020a5723cf11b4fec6ceaa3470329601 (diff)
avcodec/mpeg12enc: Simplify check for A53 closed captions
The a53_cc option is only useful and meaningful for MPEG-2, yet it was accidentally added for all mpegvideo-based encoders. This means that it is possible for a53_cc to be set for other encoders as well. This commit changes this and reroutes a53_cc to the dummy field in MpegEncContext for all codecs for which it is not supported. This allows to avoid a check for the current codec in mpeg12enc.c. Also add a compile-time check for whether the MPEG-2 encoder is available while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r--libavcodec/mpeg12enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 2fb2232f3c..abb0a4b29f 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -551,7 +551,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
}
}
- if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->a53_cc) {
+ if (CONFIG_MPEG2VIDEO_ENCODER && s->a53_cc) {
side_data = av_frame_get_side_data(s->current_picture_ptr->f,
AV_FRAME_DATA_A53_CC);
if (side_data) {