changeset 4480:0919d2ec5e22

Cleaned up some code
author mswitch
date Sat, 02 Feb 2002 18:09:35 +0000
parents 423ce4451ca8
children b8ec9cc1b2c5
files libvo/vo_dxr3.c
diffstat 1 files changed, 9 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_dxr3.c	Sat Feb 02 17:35:53 2002 +0000
+++ b/libvo/vo_dxr3.c	Sat Feb 02 18:09:35 2002 +0000
@@ -6,6 +6,9 @@
  */
 
 /* ChangeLog added 2002-01-10
+ * 2002-02-02:
+ *  Cleaned out some old code which might have slowed down writes
+ *
  * 2002-01-17:
  *  Testrelease of new sync engine (using previously undocumented feature of em8300).
  *
@@ -87,12 +90,7 @@
 #ifdef USE_MP1E
 void write_dxr3(rte_context *context, void *data, size_t size, void *user_data)
 {
-	size_t data_left = size;
-	
-	/* Force data into the buffer */
-	while (data_left) {
-		data_left -= write(fd_video, (void*) data + (size - data_left), data_left);
-	}
+	write(fd_video, data, size);
 }
 #endif
 
@@ -378,18 +376,11 @@
 {
 	if (img_format == IMGFMT_MPEGPES) {
 		vo_mpegpes_t *p = (vo_mpegpes_t *) src[0];
-		size_t data_left = p->size;
 
 		if (p->id == 0x20) {
-			/* Force subpic data into buffer */
-			while (data_left) {
-				data_left -= write(fd_spu, (void*) (p->data + p->size-data_left), data_left);
-			}
+			write(fd_spu, p->data, p->size);
 		} else {
-			/* Force video data into buffer */
-			while (data_left) {
-				data_left -= write(fd_video, (void*) (p->data + p->size-data_left), data_left);
-			}
+			write(fd_video, p->data, p->size);
 		}
 		return 0;
 	}
@@ -430,14 +421,12 @@
 
 static void flip_page(void)
 {
-	static int prev_pts = 0;
 	/* Flush the device if a seek occured */
-	if (prev_pts > vo_pts) {
+	if (!vo_pts) {
 		/* Flush video */
 		ioval = EM8300_SUBDEVICE_VIDEO;
 		ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
 	}
-	prev_pts = vo_pts;
 #ifdef USE_MP1E
 	if (img_format == IMGFMT_YV12) {
 		mp1e_buffer.data = picture_data[0];
@@ -554,10 +543,10 @@
 
 static uint32_t preinit(const char *arg)
 {
-  return 0;
+	return 0;
 }
 
 static void query_vaa(vo_vaa_t *vaa)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+	memset(vaa, 0, sizeof(vo_vaa_t));
 }