projects
/
IRC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reformat benchmark source codes to meet the requirements of the annotation generation.
[IRC.git]
/
Robust
/
src
/
Benchmarks
/
SSJava
/
MP3DecoderInfer
/
Player.java
diff --git
a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java
b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java
index f9593476afed3c26f0c10855edcb7c74c107e663..c7ef1c0f4310310a6df6c158b0cf1b68891da0ba 100644
(file)
--- a/
Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java
+++ b/
Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java
@@
-37,7
+37,7
@@
public class Player {
/**
\r
* The current frame number.
\r
*/
\r
/**
\r
* The current frame number.
\r
*/
\r
-
\r
+
\r
private int frame = 0;
\r
\r
/**
\r
private int frame = 0;
\r
\r
/**
\r
@@
-59,19
+59,17
@@
public class Player {
/**
\r
* Has the player been closed?
\r
*/
\r
/**
\r
* Has the player been closed?
\r
*/
\r
-
\r
+
\r
private boolean closed = false;
\r
\r
/**
\r
* Has the player played back all frames from the stream?
\r
*/
\r
private boolean closed = false;
\r
\r
/**
\r
* Has the player played back all frames from the stream?
\r
*/
\r
-
\r
+
\r
private boolean complete = false;
\r
\r
private boolean complete = false;
\r
\r
-
\r
private int lastPosition = 0;
\r
\r
private int lastPosition = 0;
\r
\r
-
\r
private long sampleNumber;
\r
\r
/**
\r
private long sampleNumber;
\r
\r
/**
\r
@@
-110,20
+108,19
@@
public class Player {
* @return true if the last frame was played, or false if there are more
\r
* frames.
\r
*/
\r
* @return true if the last frame was played, or false if there are more
\r
* frames.
\r
*/
\r
-
\r
-
\r
- public boolean play( int frames) throws JavaLayerException {
\r
- boolean ret = true;
\r
+
\r
+ public boolean play(int frames) throws JavaLayerException {
\r
+ boolean ret = true;
\r
\r
// initialization before ssjava loop
\r
\r
// initialization before ssjava loop
\r
-
boolean init = true;
\r
-
Header h = BitstreamWrapper.readFrame();
\r
+ boolean init = true;
\r
+ Header h = BitstreamWrapper.readFrame();
\r
decoder.init(h);
\r
\r
sampleNumber = 1;
\r
System.out.println("Gobble sentinel: +++");
\r
\r
decoder.init(h);
\r
\r
sampleNumber = 1;
\r
System.out.println("Gobble sentinel: +++");
\r
\r
- //
int count = 0;
\r
+ // int count = 0;
\r
SSJAVA: while (true) {
\r
if (h == null) {
\r
break;
\r
SSJAVA: while (true) {
\r
if (h == null) {
\r
break;
\r
@@
-189,9
+186,8
@@
public class Player {
*
\r
* @return true if there are no more frames to decode, false otherwise.
\r
*/
\r
*
\r
* @return true if there are no more frames to decode, false otherwise.
\r
*/
\r
-
\r
- protected boolean decodeFrame( boolean init, Header h)
\r
- throws JavaLayerException {
\r
+
\r
+ protected boolean decodeFrame(boolean init, Header h) throws JavaLayerException {
\r
try {
\r
// AudioDevice out = audio;
\r
// if (out==null)
\r
try {
\r
// AudioDevice out = audio;
\r
// if (out==null)
\r
@@
-202,12
+198,12
@@
public class Player {
// if (h == null){
\r
// return false;
\r
// }
\r
// if (h == null){
\r
// return false;
\r
// }
\r
-
\r
- //
SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h);
\r
+
\r
+ // SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h);
\r
decoder.decodeFrame(h);
\r
\r
decoder.decodeFrame(h);
\r
\r
-
//
DEBUG_OUTPUT_CHECKSUM();
\r
-
//
DEBUG_OUTPUT();
\r
+
//
DEBUG_OUTPUT_CHECKSUM();
\r
+
//
DEBUG_OUTPUT();
\r
// synchronized (this)
\r
// {
\r
// out = audio;
\r
// synchronized (this)
\r
// {
\r
// out = audio;
\r
@@
-247,10
+243,10
@@
public class Player {
@TRUST
\r
public void DEBUG_OUTPUT_CHECKSUM() {
\r
// eom debug
\r
@TRUST
\r
public void DEBUG_OUTPUT_CHECKSUM() {
\r
// eom debug
\r
-
int sum = 0;
\r
-
short[] outbuf = SampleBufferWrapper.getBuffer();
\r
+ int sum = 0;
\r
+ short[] outbuf = SampleBufferWrapper.getBuffer();
\r
// short[] outbuf = output.getBuffer();
\r
// short[] outbuf = output.getBuffer();
\r
- TERMINATE: for (
int i = 0; i < SampleBufferWrapper.getBufferLength(); i++) {
\r
+ TERMINATE: for (int i = 0; i < SampleBufferWrapper.getBufferLength(); i++) {
\r
// System.out.println(outbuf[i]);
\r
sum += outbuf[i];
\r
}
\r
// System.out.println(outbuf[i]);
\r
sum += outbuf[i];
\r
}
\r