[FFmpeg-devel] [PATCH] lavc/utils: use pkt_timebase for legacy subtitles timing code
Clément Bœsch
u at pkh.me
Mon Mar 28 19:36:18 CEST 2016
On Mon, Mar 28, 2016 at 06:52:26PM +0200, wm4 wrote:
> 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.
New patch attached.
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lavc-utils-use-pkt_timebase-for-legacy-subtitles-tim.patch
Type: text/x-diff
Size: 1262 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160328/dac1949d/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160328/dac1949d/attachment.sig>
More information about the ffmpeg-devel
mailing list