[Mplayer-cvslog] CVS: main/libvo vo_dxr3.c,1.58,1.59

David Holm mswitch at mplayer.dev.hu
Mon Feb 18 19:23:24 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv18280/libvo

Modified Files:
	vo_dxr3.c 
Log Message:
Accidentally mixed experimental code with stable one during last commit, 
fixed...
Also updated changelog to reflect recent changes


Index: vo_dxr3.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dxr3.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- vo_dxr3.c	18 Feb 2002 17:34:20 -0000	1.58
+++ vo_dxr3.c	18 Feb 2002 18:23:14 -0000	1.59
@@ -6,6 +6,9 @@
  */
 
 /* ChangeLog added 2002-01-10
+ * 2002-02-18:
+ *  Fixed sync problems when pausing video (while using prebuffering)
+ *
  * 2002-02-16:
  *  Fixed bug which would case invalid output when using :noprebuf
  *  Removed equalization code, it caused problems on slow systems
@@ -93,7 +96,6 @@
 static int noprebuf = 0;
 static int img_format = 0;
 static SwsContext * sws = NULL;
-float scalefactor = 1.0;
 
 /* File descriptors */
 static int fd_control = -1;
@@ -103,8 +105,6 @@
 
 /* Static variable used in ioctl's */
 static int ioval = 0;
-static int ptsdiff = 0;
-static int writesize = 0;
 
 static vo_info_t vo_info = 
 {
@@ -242,9 +242,6 @@
 		printf("VO: [dxr3] Setting aspect ratio to 16:9\n");
 	}
 	ioctl(fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &ioval);
-    
-	size = s_width * s_height;
-	picture_buf = malloc((size * 3) / 2);
 	
 	if (format != IMGFMT_MPEGPES) {
 #ifdef USE_LIBAVCODEC
@@ -308,6 +305,8 @@
 		avc_picture.linesize[0] = s_width;
 		avc_picture.linesize[1] = s_width / 2;
 		avc_picture.linesize[2] = s_width / 2;
+		size = s_width * s_height;
+		picture_buf = malloc((size * 3) / 2);
 		
 		avc_picture.data[0] = picture_buf;
 		avc_picture.data[1] = avc_picture.data[0] + size;
@@ -352,9 +351,6 @@
 
 static uint32_t draw_frame(uint8_t * src[])
 {
-	if (!noprebuf) {
-		ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts);
-	}
 	if (img_format == IMGFMT_MPEGPES) {
 		vo_mpegpes_t *p = (vo_mpegpes_t *) src[0];
 		
@@ -364,16 +360,16 @@
 			}
 			write(fd_spu, p->data, p->size);
 		} else {
-			writesize = p->size;
-			memcpy(picture_buf, p->data, p->size);
+			write(fd_video, p->data, p->size);
 		}
 		return 0;
 #ifdef USE_LIBAVCODEC
 	} else {
-		int srcStride = (img_format == IMGFMT_YUY2) ? (v_width * 2) : (v_width * 3);
+		int size, srcStride = (img_format == IMGFMT_YUY2) ? (v_width * 2) : (v_width * 3);
 		sws->swScale(sws, src, &srcStride, 0, v_height, avc_picture.data, avc_picture.linesize);
 		draw_osd();
-		writesize = avcodec_encode_video(avc_context, picture_buf, avc_outbuf_size, &avc_picture);
+		size = avcodec_encode_video(avc_context, picture_buf, avc_outbuf_size, &avc_picture);
+		write(fd_video, picture_buf, size);
 		return 0;
 #endif
 	}
@@ -382,16 +378,18 @@
 
 static void flip_page(void)
 {
+	if (!noprebuf) {
+		ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts);
+	}
 #ifdef USE_LIBAVCODEC
 	if (img_format == IMGFMT_YV12) {
-		writesize = avcodec_encode_video(avc_context, picture_buf, avc_outbuf_size, &avc_picture);
+		int size = avcodec_encode_video(avc_context, picture_buf, avc_outbuf_size, &avc_picture);
 		if (!noprebuf) {
 			ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts);
 		}
+		write(fd_video, picture_buf, size);
 	}
 #endif
-	write(fd_video, picture_buf, writesize);
-	writesize = 0;
 }
 
 static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0)
@@ -415,10 +413,10 @@
 	if (avc_context) {
 		avcodec_close(avc_context);
 	}
-#endif
 	if (picture_buf) {
 		free(picture_buf);
 	}
+#endif
 	if (fd_video) {
 		close(fd_video);
 	}




More information about the MPlayer-cvslog mailing list