[MPlayer-cvslog] r30485 - trunk/libmpcodecs/vf_tfields.c

reimar subversion at mplayerhq.hu
Mon Feb 1 23:22:32 CET 2010


Author: reimar
Date: Mon Feb  1 23:22:32 2010
New Revision: 30485

Log:
Estimate pts of additional frame generated by tfields also of correct-pts is
not set, even if it is not very relevant currently.
Based on patch by John Lindgren [john lindgren tds net]

Modified:
   trunk/libmpcodecs/vf_tfields.c

Modified: trunk/libmpcodecs/vf_tfields.c
==============================================================================
--- trunk/libmpcodecs/vf_tfields.c	Mon Feb  1 23:14:17 2010	(r30484)
+++ trunk/libmpcodecs/vf_tfields.c	Mon Feb  1 23:22:32 2010	(r30485)
@@ -336,6 +336,12 @@ static int put_image(struct vf_instance_
 	return continue_buffered_image(vf);
 }
 
+static double calc_pts(double base_pts, int field)
+{
+    // FIXME this assumes 25 fps / 50 fields per second
+    return base_pts + 0.02 * field;
+}
+
 static int continue_buffered_image(struct vf_instance_s *vf)
 {
 	int i=vf->priv->buffered_i;
@@ -349,7 +355,6 @@ static int continue_buffered_image(struc
 
 	if (i == 0)
 		vf_queue_frame(vf, continue_buffered_image);
-	pts += i * .02;  // XXX not right
 
 	if (!(mpi->flags & MP_IMGFLAG_PLANAR)) bpp = mpi->bpp/8;
 	if (vf->priv->parity < 0) {
@@ -387,7 +392,7 @@ static int continue_buffered_image(struc
 				dmpi->stride[1] = 2*mpi->stride[1];
 				dmpi->stride[2] = 2*mpi->stride[2];
 			}
-			ret |= vf_next_put_image(vf, dmpi, pts);
+			ret |= vf_next_put_image(vf, dmpi, calc_pts(pts, i));
 			if (correct_pts)
 				break;
 			else
@@ -417,7 +422,7 @@ static int continue_buffered_image(struc
 				deint(dmpi->planes[2], dmpi->stride[2], mpi->planes[2], mpi->stride[2],
 					mpi->chroma_width, mpi->chroma_height, (i^!tff));
 			}
-			ret |= vf_next_put_image(vf, dmpi, pts);
+			ret |= vf_next_put_image(vf, dmpi, calc_pts(pts, i));
 			if (correct_pts)
 				break;
 			else
@@ -443,7 +448,7 @@ static int continue_buffered_image(struc
 					mpi->chroma_width, mpi->chroma_height/2,
 					dmpi->stride[2], mpi->stride[2]*2, (i^!tff));
 			}
-			ret |= vf_next_put_image(vf, dmpi, pts);
+			ret |= vf_next_put_image(vf, dmpi, calc_pts(pts, i));
 			if (correct_pts)
 				break;
 			else


More information about the MPlayer-cvslog mailing list