[FFmpeg-devel] [PATCH] wrong time base for audio in AVI

Reimar Döffinger Reimar.Doeffinger
Sat Apr 12 20:06:02 CEST 2008

On Sat, Apr 12, 2008 at 07:48:04PM +0200, Michael Niedermayer wrote:
> On Sat, Apr 12, 2008 at 06:35:36PM +0200, Reimar D?ffinger wrote:
> > Hello,
> > currently ffplay currently fails playing e.g.
> > "http://samples.mplayerhq.hu/amv/Shakira - Hips Don't Lie.amv"
> > with
> > > ffplay: libavformat/utils.c:640: update_initial_durations: Assertion `pkt->duration && !st->cur_dts' failed.
> > This problem seems to be because the time base of the audio stream is
> > set to 1/10 based on the frame rate instead of 1/sample_rate and thus
> > the packet duration after av_rescale in compute_pkt_fields in
> > utils.c:669 becomes 0.
> > Attached patch is one possible way to fix this.
> Ive not looked at the file but the patch is definitly not a fix for it.
> It is just wrong, and i suspect it breaks many more files than it might
> fix.

Maybe, it is unclear to me what exactly is not behaving as intended,
that assert in update_initial_durations is based on an awful lot of
conditions/assumptions, e.g. that the result of compute_frame_duration
fits into a time base. I just assumed that this assumption means that
the audio time_base _always_ must be a "multiple" of the sample rate,
otherwise I can't see how this should be able to guarantee for e.g.
broken files.

Reimar D?ffinger

More information about the ffmpeg-devel mailing list