aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-03-28 14:15:42 +0200
committerClément Bœsch <u@pkh.me>2016-04-02 19:03:06 +0200
commitffd1c3eeb7043a51d1483ce7fb56772d32f02963 (patch)
tree95c6eca10426dc4b644d2ff90c71f13c0fea3037 /libavcodec
parentd8620158c7ec9d571b70a54115af8fdaf4d765e5 (diff)
downloadffmpeg-ffd1c3eeb7043a51d1483ce7fb56772d32f02963.tar.gz
lavc/utils: use pkt_timebase for legacy subtitles timing code
This is consistent with other AVSubtitle timing adjustments.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f991135d7f..23d9622242 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2585,8 +2585,11 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
#if FF_API_ASS_TIMING
if (avctx->sub_text_format == FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS
- && *got_sub_ptr && sub->num_rects)
- ret = convert_sub_to_old_ass_form(sub, avpkt, avctx->time_base);
+ && *got_sub_ptr && sub->num_rects) {
+ const AVRational tb = avctx->pkt_timebase.num ? avctx->pkt_timebase
+ : avctx->time_base;
+ ret = convert_sub_to_old_ass_form(sub, avpkt, tb);
+ }
#endif
if (sub->num_rects && !sub->end_display_time && avpkt->duration &&