Hi,

On Thu, May 26, 2011 at 7:42 AM, Stefano Sabatini
<[email protected]> wrote:
> On date Wednesday 2011-05-25 15:57:01 -0400, Ronald S. Bultje encoded:
>> On Wed, May 25, 2011 at 10:27 AM, Anton Khirnov <[email protected]> wrote:
>> > ---
>> >  libavdevice/v4l.c |   21 +++++++++------------
>> >  1 files changed, 9 insertions(+), 12 deletions(-)
>> >
>> > diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c
>> > index bd011e1..94b670a 100644
>> > --- a/libavdevice/v4l.c
>> > +++ b/libavdevice/v4l.c
>> > @@ -42,7 +42,7 @@ typedef struct {
>> >     int fd;
>> >     int frame_format; /* see VIDEO_PALETTE_xxx */
>> >     int use_mmap;
>> > -    AVRational time_base;
>> > +    AVRational fps;
>> >     int64_t time_frame;
>> >     int frame_size;
>> >     struct video_capability video_cap;
>> > @@ -85,12 +85,6 @@ static int grab_read_header(AVFormatContext *s1, 
>> > AVFormatParameters *ap)
>> >     int vformat_num = FF_ARRAY_ELEMS(video_formats);
>> >     enum PixelFormat pix_fmt = av_get_pix_fmt(s->pix_fmt);
>> >
>> > -    if (ap->time_base.den <= 0) {
>> > -        av_log(s1, AV_LOG_ERROR, "Wrong time base (%d)\n", 
>> > ap->time_base.den);
>> > -        return -1;
>> > -    }
>> > -    s->time_base = ap->time_base;
>> [..]
>> > -        s->time_frame = av_gettime() * s->time_base.den / 
>> > s->time_base.num;
>> > +        s->time_frame = av_gettime() * s->fps.num / s->fps.den;
>>
>> I don't think this is really a framerate, this is really actually a
>> time base. Right?
>
> time_frame is an unhappy name choice, but unrelated to the patch.

not time_frame; time_base.

It is the unit in which timestamps are represented. If set to 1/25,
then a timestamp of 40ms will be 1, 80ms 2, etc. If set to 1/1000, 40
ms will be 40, 80 ms 80, etc.

It is _not_ a framerate or timerate or timeframe. It is the time_base.

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

Reply via email to