[FFmpeg-devel] [PATCH 2/3] lavf/aiffdec: don't stop parsing after SSND chunk

Michael Niedermayer michaelni at gmx.at
Mon Oct 22 19:39:13 CEST 2012


On Mon, Oct 22, 2012 at 06:47:35PM +0200, Matthieu Bouron wrote:
> On Sun, Jul 01, 2012 at 11:03:29PM +0200, Michael Niedermayer wrote:
> > On Sun, Jul 01, 2012 at 10:37:24PM +0200, Matthieu Bouron wrote:
> > > On Sun, Jul 01, 2012 at 08:59:04PM +0200, Michael Niedermayer wrote:
> > > > On Sun, Jul 01, 2012 at 08:10:45PM +0200, Matthieu Bouron wrote:
> > > > > On Sun, Jul 01, 2012 at 04:18:58PM +0200, Michael Niedermayer wrote:
> > > > > > On Sun, Jul 01, 2012 at 11:16:42AM +0200, Matthieu Bouron wrote:
> > > > > > > Some file has ID3 chunk placed after SSND.
> > > > > > > ---
> > > > > > >  libavformat/aiffdec.c | 2 --
> > > > > > >  1 file changed, 2 deletions(-)
> > > > > > > 
> > > > > > > diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
> > > > > > > index 4083316..9764f82 100644
> > > > > > > --- a/libavformat/aiffdec.c
> > > > > > > +++ b/libavformat/aiffdec.c
> > > > > > > @@ -251,8 +251,6 @@ static int aiff_read_header(AVFormatContext *s)
> > > > > > >              offset = avio_rb32(pb);      /* Offset of sound data */
> > > > > > >              avio_rb32(pb);               /* BlockSize... don't care */
> > > > > > >              offset += avio_tell(pb);    /* Compute absolute data offset */
> > > > > > > -            if (st->codec->block_align)    /* Assume COMM already parsed */
> > > > > > > -                goto got_sound;
> > > > > > >              if (!pb->seekable) {
> > > > > > >                  av_log(s, AV_LOG_ERROR, "file is not seekable\n");
> > > > > > >                  return -1;
> > > > > > 
> > > > > > this will probably cause the whole file to be read in
> > > > > > aiff_read_header() in some cases
> > > > > > 
> > > > > Yes, this will cause ffmpeg to seek at the start of every chunks.
> > > > > This is required for some file (for example aiff files purchased from
> > > > > beatport.com) which has their ID3 chunk after the SSND chunk.
> > > > > 
> > > > > Maybe a better solution would be to add an option which tell the demuxer to
> > > > > look for other chunks after SSND ?
> > > > 
> > > > where is the id3 chunk exactly in relation to the audio data and
> > > > other chunks as well as offset ?
> > > > 
> > > 
> > > In my case, the ID3 chunk is placed after the entire SSND chunk (including
> > > audio data). Anyway i didn't find any documentations which specify that
> > > the ID3 chunk should be before or after the SSND chunk (or another type of
> > > chunk).
> > 
> > hmm, well thats a unfortunate layout.
> > at least a check shoudl be added if the underlaying protocol is
> > seekable, because it not we cannot move to the end of the ssnd
> > chunk because we would never be able to seek back and play anything
> > (unless it all fits in our small buffer)
> > 
> 
> I updated the patch to seek for the ID3 chunk only if the stream is
> seekable.
> 
> Best regards,
> Matthieu
> 
> [...]

>  aiffdec.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> b9ca0538902c81bdffb6741c5d394e0989342430  0001-lavf-aiffdec-don-t-stop-parsing-after-SSND-chunk.patch
> From 544163deddfe2fa7b28e49e8344e83bc17143d78 Mon Sep 17 00:00:00 2001
> From: Matthieu Bouron <matthieu.bouron at gmail.com>
> Date: Sat, 30 Jun 2012 17:53:38 +0200
> Subject: [PATCH] lavf/aiffdec: don't stop parsing after SSND chunk
> 
> Some file has ID3 chunk placed after SSND.

applied

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121022/3788b385/attachment.asc>


More information about the ffmpeg-devel mailing list