summaryrefslogtreecommitdiffstats
path: root/sub/sd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-23 20:14:08 +0200
committerwm4 <wm4@nowhere>2015-10-23 20:14:08 +0200
commit252dcdcc999115f52dc11b0fcf41367a54df8eab (patch)
treed1933bca58ff63cb469098070e34cbd14e65cee3 /sub/sd_lavc.c
parent97fc4f4a85cc62c3de34eb2d54ccf79cb76f101d (diff)
downloadmpv-252dcdcc999115f52dc11b0fcf41367a54df8eab.tar.bz2
mpv-252dcdcc999115f52dc11b0fcf41367a54df8eab.tar.xz
sd_lavc: take care of AVPicture deprecation
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r--sub/sd_lavc.c15
1 files changed, 12 insertions, 3 deletions
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 <libavutil/common.h>
#include <libavutil/intreadwrite.h>
+#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;