mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
lavc: mark bitmap based subtitles codecs as such.
This commit is contained in:
parent
7ca2f8b113
commit
8732271e40
@ -540,6 +540,10 @@ typedef struct AVCodecDescriptor {
|
|||||||
* Codec supports lossless compression. Audio and video codecs only.
|
* Codec supports lossless compression. Audio and video codecs only.
|
||||||
*/
|
*/
|
||||||
#define AV_CODEC_PROP_LOSSLESS (1 << 2)
|
#define AV_CODEC_PROP_LOSSLESS (1 << 2)
|
||||||
|
/**
|
||||||
|
* Subtitle codec is bitmap based
|
||||||
|
*/
|
||||||
|
#define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
|
||||||
|
|
||||||
#if FF_API_OLD_DECODE_AUDIO
|
#if FF_API_OLD_DECODE_AUDIO
|
||||||
/* in bytes */
|
/* in bytes */
|
||||||
|
@ -2371,12 +2371,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
|
|||||||
.type = AVMEDIA_TYPE_SUBTITLE,
|
.type = AVMEDIA_TYPE_SUBTITLE,
|
||||||
.name = "dvd_subtitle",
|
.name = "dvd_subtitle",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"),
|
.long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"),
|
||||||
|
.props = AV_CODEC_PROP_BITMAP_SUB,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.id = AV_CODEC_ID_DVB_SUBTITLE,
|
.id = AV_CODEC_ID_DVB_SUBTITLE,
|
||||||
.type = AVMEDIA_TYPE_SUBTITLE,
|
.type = AVMEDIA_TYPE_SUBTITLE,
|
||||||
.name = "dvb_subtitle",
|
.name = "dvb_subtitle",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"),
|
.long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"),
|
||||||
|
.props = AV_CODEC_PROP_BITMAP_SUB,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.id = AV_CODEC_ID_TEXT,
|
.id = AV_CODEC_ID_TEXT,
|
||||||
@ -2389,6 +2391,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
|
|||||||
.type = AVMEDIA_TYPE_SUBTITLE,
|
.type = AVMEDIA_TYPE_SUBTITLE,
|
||||||
.name = "xsub",
|
.name = "xsub",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("XSUB"),
|
.long_name = NULL_IF_CONFIG_SMALL("XSUB"),
|
||||||
|
.props = AV_CODEC_PROP_BITMAP_SUB,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.id = AV_CODEC_ID_SSA,
|
.id = AV_CODEC_ID_SSA,
|
||||||
@ -2407,6 +2410,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
|
|||||||
.type = AVMEDIA_TYPE_SUBTITLE,
|
.type = AVMEDIA_TYPE_SUBTITLE,
|
||||||
.name = "hdmv_pgs_subtitle",
|
.name = "hdmv_pgs_subtitle",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"),
|
.long_name = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"),
|
||||||
|
.props = AV_CODEC_PROP_BITMAP_SUB,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.id = AV_CODEC_ID_DVB_TELETEXT,
|
.id = AV_CODEC_ID_DVB_TELETEXT,
|
||||||
|
@ -1872,7 +1872,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
|
|||||||
sub->pts = av_rescale_q(avpkt->pts,
|
sub->pts = av_rescale_q(avpkt->pts,
|
||||||
avctx->pkt_timebase, AV_TIME_BASE_Q);
|
avctx->pkt_timebase, AV_TIME_BASE_Q);
|
||||||
ret = avctx->codec->decode(avctx, sub, got_sub_ptr, &tmp);
|
ret = avctx->codec->decode(avctx, sub, got_sub_ptr, &tmp);
|
||||||
sub->format = sub->num_rects && sub->rects[0]->ass;
|
sub->format = !(avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB);
|
||||||
|
|
||||||
avctx->pkt = NULL;
|
avctx->pkt = NULL;
|
||||||
if (did_split) {
|
if (did_split) {
|
||||||
|
Loading…
Reference in New Issue
Block a user