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

Reimar Döffinger Reimar.Doeffinger
Sat Jan 29 12:41:22 CET 2011


On Sat, Jan 29, 2011 at 03:32:17AM -0800, Baptiste Coudurier wrote:
> On 1/29/11 3:06 AM, Ronald S. Bultje wrote:
> >> I was going to say that there is no place to do this that does not include
> >> a lot of issues, but there actually is one:
> >> av_set_pts_info
> >> With the little issue that this code incorrectly bypasses that function.
> >> A lot of code does that, so a first patch is to make everyone actually
> >> use that.
> >> I probably missed an few.
> > 
> > I really like this patch. Might want a few people to check and make
> > sure we didn't miss any, but this looks very right.
> 
> Yes, that's the way to do it, but av_set_pts_info has a problem:
> It's using unsigned as parameters while AVRational is two int, and I'm
> not sure how av_reduce exactly behaves.

Just to clarify: The patch is completely useless for fixing the issue,
av_set_pts_info does not sensible checking, and the only checking it
does sets the time_base to values that _will_ trigger that assert.
So there's a good chance it makes things even worse.
But it is the only sensible way I can see to get a check that
works without extra code in every demuxer.
I does need someone investing the time though, and I am not
sure I'll feel like going beyond this.

> Demuxers should not set codec time base IMHO, although
> av_find_stream_info will set it to the stream timebase if not set.

That is my opinion as well, I just do not know whether I may have missed something.



More information about the ffmpeg-devel mailing list