[FFmpeg-devel] [PATCH] mov hacks: Fix ulaw-in-mov sample.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Mar 31 12:44:08 CEST 2012


On Sun, Mar 25, 2012 at 07:29:40PM +0200, Michael Niedermayer wrote:
> On Sun, Mar 25, 2012 at 02:06:39PM +0200, Reimar Döffinger wrote:
> > This patch fixes the sample from trac issue #522.
> > One issue is that the size of the trak elements is coded
> > too large, so that the next trak element would be parsed
> > as part of the first and truncated incorrectly.
> > The second issue is that the mov demuxer insists on using its
> > calculated sample_size (which is nonsense) instead of the one
> > encoded in the track.
> > The old raw audio code should be using the value in stsz, because
> > the size of a single sample never makes sense for the size of
> > a full audio packet, whereas the new code will multiply the
> > sample size by the chunk size, so it should use the calculated value.
> > 
> > Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> > ---
> >  libavformat/isom.h |    1 +
> >  libavformat/mov.c  |   13 ++++++++++++-
> >  2 files changed, 13 insertions(+), 1 deletions(-)
> > 
> > diff --git a/libavformat/isom.h b/libavformat/isom.h
> > index cd70c03..2d58443 100644
> > --- a/libavformat/isom.h
> > +++ b/libavformat/isom.h
> > @@ -104,6 +104,7 @@ typedef struct MOVStreamContext {
> >      int ctts_index;
> >      int ctts_sample;
> >      unsigned int sample_size;
> > +    unsigned int alt_sample_size;
> 
> please document the exact meaning of the new field
> 
> patch LGTM in absence of other reviewers

Done and applied in two parts.


More information about the ffmpeg-devel mailing list