summaryrefslogtreecommitdiff
path: root/libavcodec/webp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/webp.c')
-rw-r--r--libavcodec/webp.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 18d68e9140..0e769c307d 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1288,16 +1288,6 @@ static int vp8_lossy_decode_alpha(AVCodecContext *avctx, AVFrame *p,
return 0;
}
-static enum AVPixelFormat webp_get_format(AVCodecContext *avctx,
- const enum AVPixelFormat *formats)
-{
- WebPContext *s = avctx->priv_data;
- if (s->has_alpha)
- return AV_PIX_FMT_YUVA420P;
- else
- return AV_PIX_FMT_YUV420P;
-}
-
static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
int *got_frame, uint8_t *data_start,
unsigned int data_size)
@@ -1309,7 +1299,11 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
if (!s->initialized) {
ff_vp8_decode_init(avctx);
s->initialized = 1;
- avctx->get_format = webp_get_format;
+ s->v.actually_webp = 1;
+ if (s->has_alpha)
+ avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
+ else
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
}
s->lossless = 0;