summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index e8ad07b33f..a3cb9ee1d8 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -27,6 +27,10 @@ LIBVD_EXTERN(ffmpeg)
#include "libavcodec/avcodec.h"
+#if AVPALETTE_SIZE > 1024
+#error palette too large, adapt libmpcodecs/vf.c:vf_get_image
+#endif
+
#if CONFIG_XVMC
#include "libavcodec/xvmc.h"
#endif
@@ -593,6 +597,8 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type== MP_IMGTYPE_IPB ? "using IPB\n" : "using IP\n");
}
+ if (ctx->best_csp == IMGFMT_RGB8 || ctx->best_csp == IMGFMT_BGR8)
+ flags |= MP_IMGFLAG_RGB_PALETTE;
mpi= mpcodecs_get_image(sh, type, flags, width, height);
if (!mpi) return -1;
@@ -630,10 +636,6 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
}
#endif
- // Palette support: libavcodec copies palette to *data[1]
- if (mpi->bpp == 8)
- mpi->planes[1] = av_malloc(AVPALETTE_SIZE);
-
pic->data[0]= mpi->planes[0];
pic->data[1]= mpi->planes[1];
pic->data[2]= mpi->planes[2];