Re: server: Reuse red_get_monotonic_time() in the MJPEG video encoder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Thu, 2015-12-03 at 16:28 +0100, Francois Gouget wrote:
> > Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
> > ---
> >  server/mjpeg_encoder.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> > 
> > diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
> > index 752dae8..60060fc 100644
> > --- a/server/mjpeg_encoder.c
> > +++ b/server/mjpeg_encoder.c
> > @@ -1345,16 +1345,13 @@ MJpegEncoder *mjpeg_encoder_new(uint64_t
> > starting_bit_rate,
> >      encoder->starting_bit_rate = starting_bit_rate;
> >  
> >      if (cbs) {
> > -        struct timespec time;
> > -
> > -        clock_gettime(CLOCK_MONOTONIC, &time);
> >          encoder->cbs = *cbs;
> >          encoder->cbs_opaque = cbs_opaque;
> >          mjpeg_encoder_reset_quality(encoder, MJPEG_QUALITY_SAMPLE_NUM / 2,
> >          5,
> > 0);
> >          encoder->rate_control.during_quality_eval = TRUE;
> >          encoder->rate_control.quality_eval_data.type =
> > MJPEG_QUALITY_EVAL_TYPE_SET;
> >          encoder->rate_control.quality_eval_data.reason =
> > MJPEG_QUALITY_EVAL_REASON_RATE_CHANGE;
> > -        encoder->rate_control.warmup_start_time = ((uint64_t) time.tv_sec)
> > *
> > 1000000000 + time.tv_nsec;
> > +        encoder->rate_control.warmup_start_time =
> > red_get_monotonic_time();
> >      } else {
> >          encoder->cbs.get_roundtrip_ms = NULL;
> >          mjpeg_encoder_reset_quality(encoder,
> >          MJPEG_LEGACY_STATIC_QUALITY_ID,
> > MJPEG_MAX_FPS, 0);
> 
> Looks good.
> 
> Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>

Yes, I already merged it.
Note that is moved the time reading after mjpeg_encoder_reset_quality
(which is small anyway) but I think is even better.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]