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

wm4 nfxjfg at googlemail.com
Mon Mar 28 18:52:26 CEST 2016


On Mon, 28 Mar 2016 18:44:33 +0200
Michael Niedermayer <michael at niedermayer.cc> wrote:

> 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 ?
> 
> [...]

No they don't. It's an API change.


More information about the ffmpeg-devel mailing list