[FFmpeg-devel] [PATCH] Vorbis-in-Ogg: Do not set timebase to invalid values

Justin Ruggles justin.ruggles
Thu Feb 10 19:49:27 CET 2011

On 02/10/2011 01:05 PM, Ronald S. Bultje wrote:

> Hi,
> On Mon, Feb 7, 2011 at 1:54 PM, Reimar D?ffinger
> <Reimar.Doeffinger at gmx.de> wrote:
>> On Mon, Feb 07, 2011 at 01:32:21PM -0500, Justin Ruggles wrote:
>>> On 02/07/2011 12:40 PM, Reimar D?ffinger wrote:
>>>> On Mon, Feb 07, 2011 at 03:49:45PM +0100, Michael Niedermayer wrote:
>>>>> On Mon, Feb 07, 2011 at 09:34:53AM -0500, Justin Ruggles wrote:
>>>>>>>>>> 1) Why is anything in libavformat setting codec->time_base for decoders
>>>>>>>>>> when the documentation says that's supposed to be done by libavcodec
>>>>>>>>>> ("decoding: Set by libavcodec.")?
>>>>>>>>> Because the docs are buggy
>>>>>>> here the docs should be fixed
>>>>>> I just didn't understand what you were saying. "the docs are buggy" and
>>>>>> "leave the documentation" seems contradictory and didn't really answer
>>>>>> my questions as to the best way to move forward.  My best guess is:
>>>>>> 1) change time_base documentation to say "decoding: Set by user if
>>>>>> known, overridden by libavcodec if known"
>>>>> exactly
>>>> Uh, that does not fix the original issue. codec->time_base is set
>>>> by libavformat. That still contradicts that description.
>>>> What is the point of (AFAICT) some demuxers setting only stream->time_base
>>>> others setting stream->codec->time_base and others setting both (to the same value)?
>>> How does that contradict the description?  To libavcodec, the demuxer is
>>> the user.
>> I'd say the ffmpeg application is the user.
>> But I see how you meant it. So it's not wrong, but it does
>> not answer my real question.
>> Would a patch that removes all cases where demuxers set
>> codec->time_base (possibly using av_set_pts_info instead)
>> be accepted?
> So do I have this right:
> - AVStream->time_base is the time_base of timestamps expected by the
> muxer, or output by the demuxer
> - for encoding, AVCodecContext->time_base is the time_base for the
> packets written by the application
> - for decoding, AVCodecContext->time_base is a copy of AVStream->time_base?
> Shouldn't we mark AVCodecContext->time_base as unused during decoding
> then? It's unclear to me how it's different from AVStream->time_base
> during decoding.

But it apparently is used during decoding, and I don't think it is
always a copy of the stream time_base.  Just grep libavcodec/* for
"time_base" and look at the decoders that use it.


More information about the ffmpeg-devel mailing list