[FFmpeg-devel] [PATCH] avformat/mov: mov_build_index: pick the bigger sample_size of the 2

Michael Niedermayer michaelni at gmx.at
Fri May 24 00:48:58 CEST 2013


On Thu, May 23, 2013 at 02:23:18PM -0700, Alex Sukhanov wrote:
> On Thu, May 23, 2013 at 1:13 PM, Michael Niedermayer <michaelni at gmx.at>wrote:
> 
> > Fixes Ticket2605
> >
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavformat/mov.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index d5e1f89..9497884 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -2018,7 +2018,7 @@ static void mov_build_index(MOVContext *mov,
> > AVStream *st)
> >                  }
> >                  if (keyframe)
> >                      distance = 0;
> > -                sample_size = sc->alt_sample_size > 0 ?
> > sc->alt_sample_size : sc->sample_sizes[current_sample];
> > +                sample_size = sc->alt_sample_size > 0 ?
> > FFMAX(sc->alt_sample_size, sc->sample_size) :
> > sc->sample_sizes[current_sample];
> >                  if (sc->pseudo_stream_id == -1 ||
> >                     sc->stsc_data[stsc_index].id - 1 ==
> > sc->pseudo_stream_id) {
> >                      AVIndexEntry *e =
> > &st->index_entries[st->nb_index_entries++];
> > --
> > 1.7.9.5
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> 
> Hi Michael,
> 
> Thanks for looking on this problem. I just think that your fix potentially
> doesn't cover all cases.
> With your fix now we able to extract audio if STSZ sample_size < real
> sample_size, as we have it in my sample file:
> STSZ::sample_size = 1
> real sample size = 4
> 

> But what if STSZ::sample_size = 100
> real sample size = 4?

then the value 100 will be used


> 
> Don't you think that we should revert
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50059bde77674977d9134f3c1151a63cb7a2391c

If you revert the Fix for #522 then the sample from #522 will fail


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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- 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/20130524/4dde7efe/attachment.asc>


More information about the ffmpeg-devel mailing list