changeset 11414:8770be0a5bb5

aspect change does not flush buffers
author iive
date Sat, 08 Nov 2003 01:56:09 +0000
parents e250b0e9e608
children da41bbc78e3d
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Sat Nov 08 01:33:38 2003 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sat Nov 08 01:56:09 2003 +0000
@@ -389,7 +389,9 @@
     float aspect= avctx->aspect_ratio;
 #endif
 
-    if ( aspect != ctx->last_aspect ||
+     // it is possible another vo buffers to be used after vo config()
+     // lavc reset its buffers on width/heigh change but not on aspect change!!!
+    if (// aspect != ctx->last_aspect ||
 	avctx->width != sh->disp_w ||
 	avctx->height != sh->disp_h ||
 	!ctx->vo_inited)
@@ -833,6 +835,8 @@
     pic->type= FF_BUFFER_TYPE_USER;
 
     render=(xvmc_render_state_t*)mpi->priv;//same as data[2]
+    if(verbose > 4)
+        printf("vd_ffmpeg::mc_get_buffer (render=%p)\n",render);
     assert(render != 0);
     assert(render->magic == MP_XVMC_RENDER_MAGIC);
     render->state |= MP_XVMC_STATE_PREDICTION;
@@ -858,11 +862,11 @@
 //printf("R%X %X\n", pic->linesize[0], pic->data[0]);
 //mark the surface as not requared for prediction
     render=(xvmc_render_state_t*)pic->data[2];//same as mpi->priv
+    if(verbose > 4)
+        printf("vd_ffmpeg::mc_release_buffer (render=%p)\n",render);
     assert(render!=NULL);
     assert(render->magic==MP_XVMC_RENDER_MAGIC);
     render->state&=~MP_XVMC_STATE_PREDICTION;
-    if(verbose > 4)
-        printf("vd_ffmpeg::mc_release buffer (render=%p)\n",render);
     for(i=0; i<4; i++){
         pic->data[i]= NULL;
     }