diff -Naur -wbBE -X ignore_list main-cvs/libmpcodecs/vd_ffmpeg.c main-devel/libmpcodecs/vd_ffmpeg.c --- main-cvs/libmpcodecs/vd_ffmpeg.c 2005-04-25 09:01:06.000000000 +0800 +++ main-devel/libmpcodecs/vd_ffmpeg.c 2005-05-23 17:24:27.000000000 +0800 @@ -12,6 +12,7 @@ #include "bswap.h" #include "vd_internal.h" +#include "vf.h" static vd_info_t info = { "FFmpeg's libavcodec codec family", @@ -482,6 +483,23 @@ sh->aspect = ctx->last_aspect; sh->disp_w = avctx->width; sh->disp_h = avctx->height; + + // For H.263 videos, output size can be different to display size, + // so we insert a crop filter to force output dimension + if (sh->bih && sh->format == mmioFOURCC('h','2','6','3') && + (sh->bih->biWidth != sh->disp_w || + sh->bih->biHeight != sh->disp_h)) + { + char w_str[30]; + char h_str[30]; + char* args[] = {"w", w_str, "h", h_str, "x", "0", "y", "0", NULL}; + sprintf(w_str, "%d", sh->bih->biWidth); + sprintf(h_str, "%d", sh->bih->biHeight); + sh->vfilter = vf_open_filter(sh->vfilter, "crop", args); + mp_msg(MSGT_DECVIDEO, MSGL_V, + "[ffmpeg] auto-inserting crop filter\n"); + } + ctx->vo_inited=1; switch(pix_fmt){ // YUVJ are YUV formats that use the full Y range and not just