From 252dcdcc999115f52dc11b0fcf41367a54df8eab Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Oct 2015 20:14:08 +0200 Subject: sd_lavc: take care of AVPicture deprecation --- sub/sd_lavc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'sub/sd_lavc.c') diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index d038bfbfdf..88c45856b4 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -23,6 +23,8 @@ #include #include +#include "config.h" + #include "talloc.h" #include "common/msg.h" #include "common/av_common.h" @@ -210,12 +212,19 @@ static void decode(struct sd *sd, struct demux_packet *packet) continue; if (r->w <= 0 || r->h <= 0) continue; - img->bitmap = r->pict.data[0]; +#if HAVE_AV_SUBTITLE_NOPICT + uint8_t **data = r->data; + int *linesize = r->linesize; +#else + uint8_t **data = r->pict.data; + int *linesize = r->pict.linesize; +#endif + img->bitmap = data[0]; assert(r->nb_colors > 0); assert(r->nb_colors * 4 <= sizeof(img->palette)); - memcpy(img->palette, r->pict.data[1], r->nb_colors * 4); + memcpy(img->palette, data[1], r->nb_colors * 4); b->bitmap = img; - b->stride = r->pict.linesize[0]; + b->stride = linesize[0]; b->w = r->w; b->h = r->h; b->x = r->x; -- cgit v1.2.3