On Sun, 29 Jan 2017 22:49:51 +0200 (EET)
Martin Storsjö <[email protected]> wrote:

> > +        if (!os->bit_rate) {
> > +            // calculate average bitrate of first segment
> > +            double bitrate = (int)( (double) range_length * 8.0 *
> > AV_TIME_BASE / (double)(os->max_pts - os->start_pts) );  
> 
> Sorry for not pointing it out in the last round, but promoting this to 
> double feels a bit superfluous. Just cast to int64_t instead, that should 
> be just fine for this use case. (Floats can end up rounded differently on 
> different platforms, and even though it doesn't really matter here, having 
> it completely determinisic when easily possible is desireable.)

Which of the 3 mentions of "double" do you mean?

The last one "max_pts-start_pts" shouldn't be necessary then, because both are 
already of type int64_t.

So something like this?

  int64_t bitrate = ( (int64_t) range_length * 8 * AV_TIME_BASE / (os->max_pts 
- os->start_pts) );

But then the range check below that code doesn't make sense.

I'm confused.

Regards
Peter

Attachment: pgp7_g7TKMjdQ.pgp
Description: OpenPGP digital signature

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to