[FFmpeg-devel] [PATCH] lavc/utils: use pkt_timebase for legacy subtitles timing code

Michael Niedermayer michael at niedermayer.cc
Mon Mar 28 18:44:33 CEST 2016


On Mon, Mar 28, 2016 at 02:15:50PM +0200, Clément Bœsch wrote:
> This is consistent with other AVSubtitle timing adjustments.
> ---
>  libavcodec/utils.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index c625bbc..2c8fc9c 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -2582,8 +2582,13 @@ 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) {
> +                if (!avctx->pkt_timebase.num) {
> +                    av_log(avctx, AV_LOG_ERROR, "packet time base not set\n");
> +                    return AVERROR_BUG;
> +                }
> +                ret = convert_sub_to_old_ass_form(sub, avpkt, avctx->pkt_timebase);
> +            }
>  #endif

this change does make sense

do all apps that get into this code set avctx->pkt_timebase so that
this works though or is it otherwise guranteed to be set ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160328/60eb028f/attachment.sig>


More information about the ffmpeg-devel mailing list