[MPlayer-cvslog] r25065 - trunk/stream/stream_dvd.c

reimar subversion at mplayerhq.hu
Sat Nov 17 19:20:05 CET 2007


Author: reimar
Date: Sat Nov 17 19:20:04 2007
New Revision: 25065

Log:
Use AV_WB32 instead of manual bit-fiddling when setting DVD speed


Modified:
   trunk/stream/stream_dvd.c

Modified: trunk/stream/stream_dvd.c
==============================================================================
--- trunk/stream/stream_dvd.c	(original)
+++ trunk/stream/stream_dvd.c	Sat Nov 17 19:20:04 2007
@@ -38,6 +38,7 @@
 #include "stream_dvd.h"
 #include "stream_dvd_common.h"
 #include "libmpdemux/demuxer.h"
+#include "libavutil/intreadwrite.h"
 
 extern int stream_cache_size;
 extern char* dvd_device;
@@ -105,10 +106,9 @@ static void dvd_set_speed(char *device, 
   buffer[10] = 0xff;
   buffer[11] = 0xff;
 
-  buffer[12] = buffer[20] = (speed >> 24) & 0xff; /* <speed> kilobyte */
-  buffer[13] = buffer[21] = (speed >> 16) & 0xff;
-  buffer[14] = buffer[22] = (speed >> 8)  & 0xff;
-  buffer[15] = buffer[23] = speed & 0xff;
+  /* <speed> kilobyte */
+  AV_WB32(buffer + 12, speed);
+  AV_WB32(buffer + 20, speed);
 
   buffer[18] = buffer[26] = 0x03; /* 1 second */
   buffer[19] = buffer[27] = 0xe8;



More information about the MPlayer-cvslog mailing list