On Sun, Oct 18, 2015 at 10:47:52AM -0400, Ganesh Ajjanagadde wrote: [...] > diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c > index bb89766..16ab245 100644 > --- a/libavformat/subtitles.c > +++ b/libavformat/subtitles.c > @@ -23,6 +23,7 @@ > #include "avio_internal.h" > #include "libavutil/avassert.h" > #include "libavutil/avstring.h" > +#include "libavutil/qsort.h" > > void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb) > { > @@ -197,9 +198,12 @@ void ff_subtitles_queue_finalize(void *log_ctx, > FFDemuxSubtitlesQueue *q) > { > int i; > > - qsort(q->subs, q->nb_subs, sizeof(*q->subs), > - q->sort == SUB_SORT_TS_POS ? cmp_pkt_sub_ts_pos > - : cmp_pkt_sub_pos_ts); > + if (q->sort == SUB_SORT_TS_POS) { > + AV_QSORT(q->subs, q->nb_subs, AVPacket, cmp_pkt_sub_ts_pos); > + } > + else > + AV_QSORT(q->subs, q->nb_subs, AVPacket, cmp_pkt_sub_pos_ts); > +
Weird style. BTW, AV_QSORT() Macro should be replaced with a do { ... } while (0) form to make this kind of code safer. Also note that using these macro has an impact on final binary size which might not be worth the trouble in various cases. [...] -- Clément B.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel