From d2c70fc8879024565f4a6397d0230bffdc0afb15 Mon Sep 17 00:00:00 2001 From: Clément Bœsch Date: Thu, 23 Mar 2017 23:32:35 +0100 Subject: sws/tests/pixdesc_query: sort pixel formats --- libswscale/tests/pixdesc_query.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libswscale/tests') diff --git a/libswscale/tests/pixdesc_query.c b/libswscale/tests/pixdesc_query.c index 34b33c6851..a0c843792a 100644 --- a/libswscale/tests/pixdesc_query.c +++ b/libswscale/tests/pixdesc_query.c @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "libavutil/mem.h" #include "libswscale/swscale_internal.h" @@ -44,6 +46,13 @@ static const struct { {"usePal", usePal}, }; +static int cmp_str(const void *a, const void *b) +{ + const char *s1 = *(const char **)a; + const char *s2 = *(const char **)b; + return strcmp(s1, s2); +} + int main(void) { int i, j; @@ -60,6 +69,8 @@ int main(void) } if (pix_fmts) { + qsort(pix_fmts, nb_pix_fmts, sizeof(*pix_fmts), cmp_str); + printf("%s:\n", query_tab[i].class); for (j = 0; j < nb_pix_fmts; j++) printf(" %s\n", pix_fmts[j]); -- cgit v1.2.3