[FFmpeg-devel] [PATCH 1/8] lavf: add internal demuxer helpers for subtitles.

Michael Niedermayer michaelni at gmx.at
Mon Jun 18 19:55:04 CEST 2012


On Mon, Jun 18, 2012 at 07:37:08AM +0200, Reimar Döffinger wrote:
> On 17 Jun 2012, at 14:29, Nicolas George <nicolas.george at normalesup.org> wrote:
> > Le decadi 30 prairial, an CCXX, Clément Bœsch a écrit :
> >> 
> >> +static int cmp_pkt_sub(const void *a, const void *b)
> >> +{
> >> +    const int64_t t1 = ((const FFDemuxSubEntry *)a)->start;
> >> +    const int64_t t2 = ((const FFDemuxSubEntry *)b)->start;
> >> +    if (t1 == t2)
> >> +        return 0;
> >> +    return t1 > t2 ? 1 : -1;
> >> +}
> > 
> > The qsort function from the libc is not guaranteed to be stable. In
> > subtitles, the order of arrival of simultaneous events may be relevant.
> 
> Note that even if not required, that kind of thing can cause test failures, so it is always best to never use qsort in a way that gives it a choice.
> Also in some cases it makes sense to use your own sort function more fit for the purpose, but probably that's not the case here.

ive added our own qsort & merge sort to libavutil so there are some
choices for libc implementation independant solutions / for regression
tests

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

There seems to be only one solution to NIH syndrom, ... a shooting squad
-------------- 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/20120618/b60a1f46/attachment.asc>


More information about the ffmpeg-devel mailing list