rpms/libraw1394/F-9 libraw1394-iso_stop-fixup.patch,NONE,1.1

Jarod Wilson jwilson at fedoraproject.org
Tue Dec 9 21:26:32 UTC 2008


Author: jwilson

Update of /cvs/pkgs/rpms/libraw1394/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25553

Added Files:
	libraw1394-iso_stop-fixup.patch 
Log Message:
forgot to add patch. but hey, at least I added it *before* tagging and trying a busted build this time...

libraw1394-iso_stop-fixup.patch:

--- NEW FILE libraw1394-iso_stop-fixup.patch ---
diff -Naurp libraw1394-1.3.0.orig/juju/juju.h libraw1394-1.3.0.fix/juju/juju.h
--- libraw1394-1.3.0.orig/juju/juju.h	2008-12-09 16:18:03.638510105 -0500
+++ libraw1394-1.3.0.fix/juju/juju.h	2008-12-09 16:24:06.549432215 -0500
@@ -127,6 +127,7 @@ struct raw1394_handle {
 		int prebuffer;
 		int start_on_cycle;
 		enum raw1394_iso_dma_recv_mode recv_mode;
+		enum { ISO_STOPPED, ISO_ACTIVE } state;
 		raw1394_iso_xmit_handler_t xmit_handler;
 		raw1394_iso_recv_handler_t recv_handler;
 		unsigned char *buffer, *buffer_end, *head;
diff -Naurp libraw1394-1.3.0.orig/juju/raw1394-iso.c libraw1394-1.3.0.fix/juju/raw1394-iso.c
--- libraw1394-1.3.0.orig/juju/raw1394-iso.c	2008-12-09 16:18:03.648494860 -0500
+++ libraw1394-1.3.0.fix/juju/raw1394-iso.c	2008-12-09 16:23:37.139558061 -0500
@@ -135,7 +135,14 @@ int raw1394_iso_xmit_start(raw1394handle
 			return retval;
 	}
 
-	return queue_xmit_packets(handle, handle->iso.buf_packets);
+	retval = queue_xmit_packets(handle, handle->iso.buf_packets);
+
+	if (retval)
+		return -1;
+	else
+		handle->iso.state = ISO_ACTIVE;
+
+	return 0;
 }
 
 static int
@@ -217,7 +224,12 @@ int raw1394_iso_recv_start(raw1394handle
 	start_iso.sync = 0;
 	start_iso.handle = 0;
 
-	return ioctl(handle->iso.fd, FW_CDEV_IOC_START_ISO, &start_iso);
+	if(ioctl(handle->iso.fd, FW_CDEV_IOC_START_ISO, &start_iso))
+		return -1;
+	else
+		handle->iso.state = ISO_ACTIVE;
+
+	return 0;
 }
 
 static int handle_iso_event(raw1394handle_t handle,
@@ -438,6 +450,7 @@ iso_init(raw1394handle_t handle, int typ
 	handle->iso.head = handle->iso.buffer;
 	handle->iso.tail = handle->iso.buffer;
 	handle->iso.first_payload = handle->iso.buffer;
+	handle->iso.state = ISO_STOPPED;
 
 	return 0;
 }
@@ -514,6 +527,8 @@ void raw1394_iso_stop(raw1394handle_t ha
 	handle->iso.first_payload = handle->iso.buffer;
 	handle->iso.packet_phase = 0;
 	handle->iso.packet_count = 0;
+	handle->iso.packet_index = 0;
+	handle->iso.state = ISO_STOPPED;
 }
 
 void raw1394_iso_shutdown(raw1394handle_t handle)
@@ -523,7 +538,10 @@ void raw1394_iso_shutdown(raw1394handle_
 		       handle->iso.buf_packets * handle->iso.max_packet_size);
 		handle->iso.buffer = NULL;
 	}
+	if (handle->iso.state != ISO_STOPPED)
+		raw1394_iso_stop(handle);
 	close(handle->iso.fd);
 	free(handle->iso.packets);
 	handle->iso.packets = NULL;
+	handle->iso.fd = -1;
 }




More information about the fedora-extras-commits mailing list