diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-05-17 17:20:11 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-05-28 10:47:59 +0200 |
commit | ec75b79fe148174fa704e09c7235e1ea9a4c2680 (patch) | |
tree | 6077828540e6dff86d43525643e3e7a4b445cba9 /fftools/ffmpeg_enc.c | |
parent | 2b3905254ea1a38532278c38d2fe1b5f16ca95b9 (diff) | |
download | ffmpeg-ec75b79fe148174fa704e09c7235e1ea9a4c2680.tar.gz |
fftools/ffmpeg: fail earlier on text/bitmap subtitles mismatch
Checking whether the user requested an unsupported conversion between
text and bitmap subtitles can be done immediately when creating the
output stream.
Diffstat (limited to 'fftools/ffmpeg_enc.c')
-rw-r--r-- | fftools/ffmpeg_enc.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 59e9466420..f023657a07 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -345,24 +345,6 @@ int enc_open(OutputStream *ost, AVFrame *frame) dec_ctx->subtitle_header_size); enc_ctx->subtitle_header_size = dec_ctx->subtitle_header_size; } - if (ist && ist->dec->type == AVMEDIA_TYPE_SUBTITLE && - enc_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) { - int input_props = 0, output_props = 0; - AVCodecDescriptor const *input_descriptor = - avcodec_descriptor_get(ist->dec->id); - AVCodecDescriptor const *output_descriptor = - avcodec_descriptor_get(enc_ctx->codec_id); - if (input_descriptor) - input_props = input_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); - if (output_descriptor) - output_props = output_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); - if (input_props && output_props && input_props != output_props) { - av_log(ost, AV_LOG_ERROR, - "Subtitle encoding currently only possible from text to text " - "or bitmap to bitmap"); - return AVERROR_INVALIDDATA; - } - } break; default: |