/** {@inheritDoc} */
@Override
protected void onPing(RTMPConnection conn, Channel channel, Header source, Ping ping) {
switch (ping.getEventType()) {
case Ping.CLIENT_BUFFER:
SetBuffer setBuffer = (SetBuffer) ping;
// get the stream id
int streamId = setBuffer.getStreamId();
// get requested buffer size in milliseconds
int buffer = setBuffer.getBufferLength();
log.debug("Client sent a buffer size: {} ms for stream id: {}", buffer, streamId);
IClientStream stream = null;
if (streamId != 0) {
// The client wants to set the buffer time
stream = conn.getStreamById(streamId);