summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-30 00:53:08 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-30 00:56:10 +0200
commitd46b86bc7c39082b26ec71aa16431f3275d836ff (patch)
tree035da87ed658f7d75c0eba5a5d4de5462a4c8ddd /libmpcodecs/vd_ffmpeg.c
parenta06b32b64e91082c11f747e2910f10a4afd3dfa9 (diff)
parent3e8f2815c19703f5cb6f75db2910234d499d9676 (diff)
downloadmpv-d46b86bc7c39082b26ec71aa16431f3275d836ff.tar.bz2
mpv-d46b86bc7c39082b26ec71aa16431f3275d836ff.tar.xz
Merge svn changes up to r30136
Ignore another broken correct-pts change in 30134.
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 52e11623db..a89e0a4dbe 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -29,6 +29,10 @@ static const vd_info_t info = {
#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
@@ -533,6 +537,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;
@@ -570,10 +576,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];