You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
lavf/subtitles: error out in case of bitmap subtitles.
This commit is contained in:
@@ -267,6 +267,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
|
|||||||
AVFormatContext *fmt = NULL;
|
AVFormatContext *fmt = NULL;
|
||||||
AVCodecContext *dec_ctx = NULL;
|
AVCodecContext *dec_ctx = NULL;
|
||||||
AVCodec *dec = NULL;
|
AVCodec *dec = NULL;
|
||||||
|
AVCodecDescriptor *dec_desc;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
AVPacket pkt;
|
AVPacket pkt;
|
||||||
AssContext *ass = ctx->priv;
|
AssContext *ass = ctx->priv;
|
||||||
@@ -309,6 +310,12 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
|
|||||||
avcodec_get_name(dec_ctx->codec_id));
|
avcodec_get_name(dec_ctx->codec_id));
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
dec_desc = avcodec_descriptor_get(dec_ctx->codec_id);
|
||||||
|
if (dec_desc && (dec_desc->props & AV_CODEC_PROP_BITMAP_SUB)) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
|
"Only text based subtitles are currently supported\n");
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
}
|
||||||
if (ass->charenc)
|
if (ass->charenc)
|
||||||
av_dict_set(&codec_opts, "sub_charenc", ass->charenc, 0);
|
av_dict_set(&codec_opts, "sub_charenc", ass->charenc, 0);
|
||||||
ret = avcodec_open2(dec_ctx, dec, &codec_opts);
|
ret = avcodec_open2(dec_ctx, dec, &codec_opts);
|
||||||
|
Reference in New Issue
Block a user