Skip to content

Commit

Permalink
added metadata bytes to total byte count
Browse files Browse the repository at this point in the history
  • Loading branch information
segler-alex committed Jun 25, 2017
1 parent c8026c4 commit 5ea0163
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ private void defaultStream(ShoutcastInfo info) throws Exception{
bytesUntilMetaData -= readBytes;
}

Log.v(TAG, "in:" + readBytes);
Log.v(TAG, "out:" + readBytesBuffer);
Log.v(TAG, "stream bytes relayed:" + readBytes);
out.write(buf, 0, readBytesBuffer);
if (fileOutputStream != null) {
Log.v(TAG, "writing to record file..");
fileOutputStream.write(buf, 0, readBytesBuffer);
}
readBytesBuffer = 0;
} else {
readMetaData();
readBytes = readMetaData();
bytesUntilMetaData = info.metadataOffset;
connectionBytesTotal += readBytes;
}
}
}

private void readMetaData() throws IOException {
private int readMetaData() throws IOException {
int metadataBytes = in.read() * 16;
int metadataBytesToRead = metadataBytes;
int readBytesBufferMetadata = 0;
Expand Down Expand Up @@ -168,6 +168,7 @@ private void readMetaData() throws IOException {
}
}
}
return readBytesBufferMetadata + 1;
}

private void streamFile(String urlStr) throws IOException {
Expand Down

0 comments on commit 5ea0163

Please sign in to comment.