[FFmpeg-devel] [PATCH] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list. Fixes gapless decoding.
isasi at google.com
Wed Sep 21 00:29:31 EEST 2016
On Mon, Sep 19, 2016 at 9:22 PM, Michael Niedermayer <michael at niedermayer.cc
> On Mon, Sep 19, 2016 at 06:31:31PM -0700, Sasi Inguva wrote:
> > Signed-off-by: Sasi Inguva <isasi at google.com>
> > ---
> > libavcodec/utils.c | 15 +++---
> > libavformat/mov.c | 75
> > tests/ref/fate/gaplessenc-itunes-to-ipod-aac | 2 +-
> > tests/ref/fate/gaplessenc-pcm-to-mov-aac | 2 +-
> > 4 files changed, 74 insertions(+), 20 deletions(-)
> with this
> ./ffmpeg -i H263_NM_f.mp4
> also theres a problem with initial padding with libvorbis with this
> change (similar to past acc/mp3 issues)
> The problem is that libvorbis decoder is not producing any AVFrame, when
we decode the first packet. got_frame_ptr is zero, and frame->nb_samples is
zero when we decode the first packet.
Before this patch first packet is discarded , and skip_samples is set to
After this patch also, the first packet is discarded , but skip_samples is
also set to 256. However when we call decode on first packet libvorbis
decoder , doesn't output anything in AVFrame and frame->nb_samples is zero.
So the skip_samples still remains to be consumed when the next packet is
decoded. Other decoders aac, mp3 do produce a decoded output frame on the
first packet and set the frame->nb_samples correctly, so it works for
others. I have just disabled setting skip_samples for libvorbis inside the
edit list code.
> i can provide proper testcases if needed tomorrow ?
> (too late ATM need to sleep)
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> Modern terrorism, a quick summary: Need oil, start war with country that
> has oil, kill hundread thousand in war. Let country fall into chaos,
> be surprised about raise of fundamantalists. Drop more bombs, kill more
> people, be surprised about them taking revenge and drop even more bombs
> and strip your own citizens of their rights and freedoms. to be continued
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
More information about the ffmpeg-devel