diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-01-17 14:58:44 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-01-17 14:58:44 +0000 |
commit | ed03545c3c0c5be509365e695f32e83a446c6cf8 (patch) | |
tree | bdb67b7ff3687f15de14ee5f8acf26c36348b992 /libmpcodecs | |
parent | 89d8ae77a82461e82e7a78eb0e97a1b727675edc (diff) | |
download | mpv-ed03545c3c0c5be509365e695f32e83a446c6cf8.tar.bz2 mpv-ed03545c3c0c5be509365e695f32e83a446c6cf8.tar.xz |
Reuse the fmt-conversion code instead of duplicating the functionality.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30354 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ve_lavc.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index e2ad55d0e0..dc295f72a1 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -24,6 +24,7 @@ #include "libmpdemux/muxer.h" #include "img_format.h" +#include "fmt-conversion.h" #include "mp_image.h" #include "vf.h" @@ -593,30 +594,9 @@ static int config(struct vf_instance_s* vf, } mux_v->imgfmt = lavc_param_format; - switch(lavc_param_format) - { - case IMGFMT_YV12: - lavc_venc_context->pix_fmt = PIX_FMT_YUV420P; - break; - case IMGFMT_422P: - lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; - break; - case IMGFMT_444P: - lavc_venc_context->pix_fmt = PIX_FMT_YUV444P; - break; - case IMGFMT_411P: - lavc_venc_context->pix_fmt = PIX_FMT_YUV411P; - break; - case IMGFMT_YVU9: - lavc_venc_context->pix_fmt = PIX_FMT_YUV410P; - break; - case IMGFMT_BGR32: - lavc_venc_context->pix_fmt = PIX_FMT_RGB32; - break; - default: - mp_msg(MSGT_MENCODER,MSGL_ERR,"%s is not a supported format\n", vo_format_name(lavc_param_format)); - return 0; - } + lavc_venc_context->pix_fmt = imgfmt2pixfmt(lavc_param_format); + if (lavc_venc_context->pix_fmt == PIX_FMT_NONE) + return 0; if(!stats_file) { /* lavc internal 2pass bitrate control */ |