| @@ -866,7 +866,7 @@ int show_filters(void *optctx, const char *opt, const char *arg) · 865 unmodified lines |
| 866 | 866 | |
| 867 | 867 | int show_pix_fmts(void *optctx, const char *opt, const char *arg) |
| 868 | 868 | { |
| 869 | | − enum AVPixelFormat pix_fmt; |
| 869 | + const AVPixFmtDescriptor *pix_desc = NULL; |
| 870 | 870 | |
| 871 | 871 | printf("Pixel formats:\n" |
| 872 | 872 | "I.... = Supported Input format for conversion\n" |
| @@ -882,8 +882,8 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg) · 9 unmodified lines |
| 882 | 882 | # define sws_isSupportedOutput(x) 0 |
| 883 | 883 | #endif |
| 884 | 884 | |
| 885 | | − for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) { |
| 886 | | − const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt]; |
| 885 | + while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) { |
| 886 | + enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc); |
| 887 | 887 | printf("%c%c%c%c%c %-16s %d %2d\n", |
| 888 | 888 | sws_isSupportedInput (pix_fmt) ? 'I' : '.', |
| 889 | 889 | sws_isSupportedOutput(pix_fmt) ? 'O' : '.', |
| @@ -1282,13 +1282,19 @@ void *grow_array(void *array, int elem_size, int *size, int new_size) · 392 unmodified lines |
| 1282 | 1282 | |
| 1283 | 1283 | static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbuf) |
| 1284 | 1284 | { |
| 1285 | | − FrameBuffer *buf = av_mallocz(sizeof(*buf)); |
| 1285 | + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt); |
| 1286 | + FrameBuffer *buf; |
| 1286 | 1287 | int i, ret; |
| 1287 | | − const int pixel_size = av_pix_fmt_descriptors[s->pix_fmt].comp[0].step_minus1+1; |
| 1288 | + int pixel_size; |
| 1288 | 1289 | int h_chroma_shift, v_chroma_shift; |
| 1289 | 1290 | int edge = 32; // XXX should be avcodec_get_edge_width(), but that fails on svq1 |
| 1290 | 1291 | int w = s->width, h = s->height; |
| 1291 | 1292 | |
| 1293 | + if (!desc) |
| 1294 | + return AVERROR(EINVAL); |
| 1295 | + pixel_size = desc->comp[0].step_minus1 + 1; |
| 1296 | + |
| 1297 | + buf = av_mallocz(sizeof(*buf)); |
| 1292 | 1298 | if (!buf) |
| 1293 | 1299 | return AVERROR(ENOMEM); |
| 1294 | 1300 | |