diff options
author | Clément Bœsch <u@pkh.me> | 2017-03-23 23:32:35 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-07-30 16:04:36 +0200 |
commit | d2c70fc8879024565f4a6397d0230bffdc0afb15 (patch) | |
tree | 946ec222ffbbe16d64298e958e30e4a0e5b25727 /libswscale | |
parent | ca23d3491d4c3e316b968242dc14140603b27e70 (diff) | |
download | ffmpeg-d2c70fc8879024565f4a6397d0230bffdc0afb15.tar.gz |
sws/tests/pixdesc_query: sort pixel formats
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/tests/pixdesc_query.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 <stdlib.h> + #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]); |