Commit 0a512e34 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'cigaes/master'

* cigaes/master:
  lavc: use packet duration for subtitles if necessary.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents cfaffb1a 83affcde
...@@ -2229,6 +2229,14 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, ...@@ -2229,6 +2229,14 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
ret = avctx->codec->decode(avctx, sub, got_sub_ptr, &pkt_recoded); ret = avctx->codec->decode(avctx, sub, got_sub_ptr, &pkt_recoded);
av_assert1((ret >= 0) >= !!*got_sub_ptr && av_assert1((ret >= 0) >= !!*got_sub_ptr &&
!!*got_sub_ptr >= !!sub->num_rects); !!*got_sub_ptr >= !!sub->num_rects);
if (sub->num_rects && !sub->end_display_time && avpkt->duration &&
avctx->pkt_timebase.num) {
AVRational ms = { 1, 1000 };
sub->end_display_time = av_rescale_q(avpkt->duration,
avctx->pkt_timebase, ms);
}
if (tmp.data != pkt_recoded.data) { // did we recode? if (tmp.data != pkt_recoded.data) { // did we recode?
/* prevent from destroying side data from original packet */ /* prevent from destroying side data from original packet */
pkt_recoded.side_data = NULL; pkt_recoded.side_data = NULL;
......
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