[FFmpeg-devel] [PATCH 2/3] lavfi/drawtext: take into account the timezone with basetime option.

Michael Niedermayer michaelni at gmx.at
Mon Oct 29 04:45:44 CET 2012


On Fri, Oct 26, 2012 at 07:53:09PM +0200, Clément Bœsch wrote:
> On Fri, Oct 26, 2012 at 07:25:10PM +0200, Clément Bœsch wrote:
> > On Fri, Oct 26, 2012 at 07:15:40PM +0200, Clément Bœsch wrote:
> > > This way, basetime=0 will start at 00:00:00 whatever the timezone.
> > > ---
> > >  libavfilter/vf_drawtext.c | 7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> > > index 7b67271..7653d5d 100644
> > > --- a/libavfilter/vf_drawtext.c
> > > +++ b/libavfilter/vf_drawtext.c
> > > @@ -640,8 +640,13 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
> > >      uint8_t *buf = dtext->expanded_text;
> > >      int buf_size = dtext->expanded_text_size;
> > >  
> > > -    if(dtext->basetime != AV_NOPTS_VALUE)
> > > +    if (dtext->basetime != AV_NOPTS_VALUE) {
> > >          now= picref->pts*av_q2d(ctx->inputs[0]->time_base) + dtext->basetime/1000000;
> > > +#if _XOPEN_SOURCE
> > > +        tzset();
> > > +        now += timezone;
> > > +#endif
> > > +    }
> > >  
> > >      if (!buf) {
> > >          buf_size = 2*strlen(dtext->text)+1;
> > 
> > Hum, new patch attached.
> > 
> 
> The #ifdef didn't actually serve any purpose and was wrong. Should be good
> now, sorry for the noise.
> 
> -- 
> Clément B.

>  vf_drawtext.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> d3a3d428fe3edf67d011d3140bfe594c4633696b  0002-lavfi-drawtext-take-into-account-the-timezone-with-b.patch
> From bc425cb022a374ef4d4a963a0a02961bfc1b61b1 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
> Date: Fri, 26 Oct 2012 18:41:50 +0200
> Subject: [PATCH 2/3] lavfi/drawtext: take into account the timezone with
>  basetime option.
> 
> This way, basetime=0 will start at 00:00:00 whatever the timezone.

probably ok if no time/posix experts reply

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121029/65cecc0b/attachment.asc>


More information about the ffmpeg-devel mailing list