Commit 020a4dea authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

PGS: fix end-time

Close #13744
parent 69ff84b9
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
struct decoder_sys_t { struct decoder_sys_t {
AVCODEC_COMMON_MEMBERS AVCODEC_COMMON_MEMBERS
bool b_need_ephemer; /* Does the format need the ephemer flag (no end time set) */
}; };
static subpicture_t *ConvertSubtitle(decoder_t *, AVSubtitle *, mtime_t pts, static subpicture_t *ConvertSubtitle(decoder_t *, AVSubtitle *, mtime_t pts,
...@@ -73,6 +74,7 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context, ...@@ -73,6 +74,7 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
sys->p_context = context; sys->p_context = context;
sys->p_codec = codec; sys->p_codec = codec;
sys->b_delayed_open = false; sys->b_delayed_open = false;
sys->b_need_ephemer = codec->id == AV_CODEC_ID_HDMV_PGS_SUBTITLE;
/* */ /* */
context->extradata_size = 0; context->extradata_size = 0;
...@@ -244,7 +246,8 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t ...@@ -244,7 +246,8 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t
spu->i_start = pts + ffsub->start_display_time * INT64_C(1000); spu->i_start = pts + ffsub->start_display_time * INT64_C(1000);
spu->i_stop = pts + ffsub->end_display_time * INT64_C(1000); spu->i_stop = pts + ffsub->end_display_time * INT64_C(1000);
spu->b_absolute = true; /* We have offset and size for subtitle */ spu->b_absolute = true; /* We have offset and size for subtitle */
spu->b_ephemer = false; /* We only show subtitle for i_stop time only */ spu->b_ephemer = dec->p_sys->b_need_ephemer;
/* We only show subtitle for i_stop time only */
if (avctx->coded_width != 0 && avctx->coded_height != 0) { if (avctx->coded_width != 0 && avctx->coded_height != 0) {
spu->i_original_picture_width = avctx->coded_width; spu->i_original_picture_width = avctx->coded_width;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment