Skip to content

Commit 2b18229

Browse files
Robert HeniganHenigan
andauthored
Make sure mOutputQueue capacity is never < 1 (#1680)
Co-authored-by: Henigan <rheniga1@MGC12Z921DLVCG.fbpld77.ford.com>
1 parent a0f080a commit 2b18229

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public StreamPacketizer(IStreamListener streamListener, InputStream is, SessionT
8686
bufferSize = BUFF_READ_SIZE;
8787
buffer = new byte[bufferSize];
8888
}
89-
mOutputQueue = new LinkedBlockingQueue<>(MAX_QUEUE_SIZE / bufferSize);
89+
mOutputQueue = new LinkedBlockingQueue<>(Math.max(MAX_QUEUE_SIZE / bufferSize, 1));
9090
}
9191

9292
public void start() throws IOException {

base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public RTPH264Packetizer(IStreamListener streamListener,
124124
bufferSize = MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE;
125125
}
126126

127-
mOutputQueue = new LinkedBlockingQueue<>(MAX_QUEUE_SIZE / bufferSize);
127+
mOutputQueue = new LinkedBlockingQueue<>(Math.max(MAX_QUEUE_SIZE / bufferSize, 1));
128128
mNALUnitReader = new NALUnitReader();
129129
mPayloadType = DEFAULT_RTP_PAYLOAD_TYPE;
130130

0 commit comments

Comments
 (0)