src/share/classes/com/sun/media/sound/DirectAudioDevice.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -493,11 +493,11 @@
                     }
                 }
             }
 
             // align buffer to full frames
-            bufferSize = ((int) bufferSize / format.getFrameSize()) * format.getFrameSize();
+            bufferSize = ( bufferSize / format.getFrameSize()) * format.getFrameSize();
 
             id = nOpen(mixerIndex, deviceID, isSource,
                     encoding,
                     hardwareFormat.getSampleRate(),
                     hardwareFormat.getSampleSizeInBits(),

@@ -1379,11 +1379,11 @@
                     int toWriteFrames = (int) (endFrame - framePos + 1);
                     int toWriteBytes = toWriteFrames * frameSize;
                     if (toWriteBytes > getBufferSize()) {
                         toWriteBytes = Toolkit.align(getBufferSize(), frameSize);
                     }
-                    int written = write(audioData, (int) clipBytePosition, toWriteBytes); // increases bytePosition
+                    int written = write(audioData, clipBytePosition, toWriteBytes); // increases bytePosition
                     clipBytePosition += written;
                     // make sure nobody called setFramePosition, or stop() during the write() call
                     if (doIO && newFramePosition < 0 && written >= 0) {
                         framePos = clipBytePosition / frameSize;
                         // since endFrame is the last frame to be played,