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

Michael Niedermayer michaelni
Sat Apr 12 20:34:31 CEST 2008


On Sat, Apr 12, 2008 at 08:06:02PM +0200, Reimar D?ffinger wrote:
> 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.

What happens if we just dont call update_initial_durations() if duration==0?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080412/11f46a27/attachment.pgp>



More information about the ffmpeg-devel mailing list