diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c index 3a33933605..6b98554608 100644 --- a/sub/lavc_conv.c +++ b/sub/lavc_conv.c @@ -103,6 +103,7 @@ struct lavc_conv *lavc_conv_create(struct sd *sd) priv->avctx = avctx; priv->extradata = talloc_strndup(priv, avctx->subtitle_header, avctx->subtitle_header_size); + mp_codec_info_from_av(avctx, sd->codec); return priv; error: diff --git a/sub/sd_ass.c b/sub/sd_ass.c index a64ba92109..d04a40a1de 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -285,6 +285,17 @@ static int init(struct sd *sd) ctx->packer = mp_ass_packer_alloc(ctx); + // Subtitles does not have any profile value, so put the converted type as a profile. + const char **desc = ctx->converter ? &sd->codec->codec_profile : &sd->codec->codec_desc; + switch (ctx->ass_track->track_type) { + case TRACK_TYPE_ASS: + *desc = "Advanced Sub Station Alpha"; + break; + case TRACK_TYPE_SSA: + *desc = "Sub Station Alpha"; + break; + } + return 0; } diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index 6c1bdf550e..d646b207c4 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -56,6 +56,7 @@ struct seekpoint { }; struct sd_lavc_priv { + struct mp_codec_params *codec; AVCodecContext *avctx; AVPacket *avpkt; AVRational pkt_timebase; @@ -119,6 +120,7 @@ static int init(struct sd *sd) } priv->avpkt = av_packet_alloc(); + priv->codec = sd->codec; if (!priv->avpkt) goto error; if (mp_set_avctx_codec_headers(ctx, sd->codec) < 0) @@ -347,6 +349,8 @@ static void decode(struct sd *sd, struct demux_packet *packet) if (res < 0 || !got_sub) return; + mp_codec_info_from_av(ctx, priv->codec); + packet->sub_duration = sub.end_display_time; if (sub.pts != AV_NOPTS_VALUE)