[FFmpeg-cvslog] lavc/utils: use pkt_timebase for legacy subtitles timing code
Clément Bœsch
git at videolan.org
Sat Apr 2 19:12:25 CEST 2016
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Mar 28 14:15:42 2016 +0200| [ffd1c3eeb7043a51d1483ce7fb56772d32f02963] | committer: Clément Bœsch
lavc/utils: use pkt_timebase for legacy subtitles timing code
This is consistent with other AVSubtitle timing adjustments.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ffd1c3eeb7043a51d1483ce7fb56772d32f02963
---
libavcodec/utils.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f991135..23d9622 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 &&
More information about the ffmpeg-cvslog
mailing list