diff options
author | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-03-01 20:21:58 +0000 |
---|---|---|
committer | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-03-01 20:21:58 +0000 |
commit | 18abbb69a1198ab205444219aad830d20a8acd9c (patch) | |
tree | a0a29016c7a1d17bc8e7cdac20108975f73b1608 /libmpcodecs/vf.c | |
parent | 9bc6e8097212e5358a0dce1dda158b0f05e017d9 (diff) | |
download | mpv-18abbb69a1198ab205444219aad830d20a8acd9c.tar.bz2 mpv-18abbb69a1198ab205444219aad830d20a8acd9c.tar.xz |
fixes for encoding of multiple files
- do not uninitialize video encoder between files
- checks for image size & format change moved from mencoder.c to vfilters
by Oded Shimon <ods15@ods15.dyndns.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14879 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf.c')
-rw-r--r-- | libmpcodecs/vf.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 0bebfcc49e..e510d99e31 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -541,6 +541,37 @@ void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src){ dst->qscale= src->qscale; } } +/** + * \brief Video config() function wrapper + * + * Blocks config() calls with different size or format for filters + * with VFCAP_CONSTANT + * + * First call is redirected to vf->config. + * + * In following calls, it verifies that the configuration parameters + * are unchanged, and returns either success or error. + * +*/ +int vf_config_wrapper(struct vf_instance_s* vf, + int width, int height, int d_width, int d_height, + unsigned int flags, unsigned int outfmt) +{ + if ((vf->default_caps&VFCAP_CONSTANT) && vf->fmt.have_configured) { + if ((vf->fmt.orig_width != width) + || (vf->fmt.orig_height != height) + || (vf->fmt.orig_fmt != outfmt)) { + mp_msg(MSGT_VFILTER,MSGL_FATAL,MSGTR_ResolutionDoesntMatch); + return 0; + } + return 1; + } + vf->fmt.have_configured = 1; + vf->fmt.orig_height = height; + vf->fmt.orig_width = width; + vf->fmt.orig_fmt = outfmt; + vf->config(vf, width, height, d_width, d_height, flags, outfmt); +} int vf_next_config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, @@ -571,7 +602,7 @@ int vf_next_config(struct vf_instance_s* vf, vf->next=vf2; } vf->next->w = width; vf->next->h = height; - return vf->next->config(vf->next,width,height,d_width,d_height,voflags,outfmt); + return vf_config_wrapper(vf->next,width,height,d_width,d_height,voflags,outfmt); } int vf_next_control(struct vf_instance_s* vf, int request, void* data){ |