[MPlayer-cvslog] r30354 - trunk/libmpcodecs/ve_lavc.c
reimar
subversion at mplayerhq.hu
Sun Jan 17 15:58:44 CET 2010
Author: reimar
Date: Sun Jan 17 15:58:44 2010
New Revision: 30354
Log:
Reuse the fmt-conversion code instead of duplicating the functionality.
Modified:
trunk/libmpcodecs/ve_lavc.c
Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c Sun Jan 17 15:54:38 2010 (r30353)
+++ trunk/libmpcodecs/ve_lavc.c Sun Jan 17 15:58:44 2010 (r30354)
@@ -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*
}
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 */
More information about the MPlayer-cvslog
mailing list