lavc/utils: use pkt_timebase for legacy subtitles timing code

This is consistent with other AVSubtitle timing adjustments.
This commit is contained in:
Clément Bœsch 2016-03-28 14:15:42 +02:00
parent d8620158c7
commit ffd1c3eeb7
1 changed files with 5 additions and 2 deletions

View File

@ -2585,8 +2585,11 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
#if FF_API_ASS_TIMING #if FF_API_ASS_TIMING
if (avctx->sub_text_format == FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS if (avctx->sub_text_format == FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS
&& *got_sub_ptr && sub->num_rects) && *got_sub_ptr && sub->num_rects) {
ret = convert_sub_to_old_ass_form(sub, avpkt, avctx->time_base); const AVRational tb = avctx->pkt_timebase.num ? avctx->pkt_timebase
: avctx->time_base;
ret = convert_sub_to_old_ass_form(sub, avpkt, tb);
}
#endif #endif
if (sub->num_rects && !sub->end_display_time && avpkt->duration && if (sub->num_rects && !sub->end_display_time && avpkt->duration &&