|
|
@@ -63,7 +63,9 @@ public class FlvRealtimeStreamRelay extends StreamRelay {
|
|
|
|
|
|
// 还没有视频设备连接可直接返回true
|
|
|
if (channelId == null || channelId.isEmpty())
|
|
|
- return true;
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
// 补发FLV头+视频序列头
|
|
|
byte[] initVideoSegment = getChannelInitVideoSegment(channelId);
|
|
|
@@ -72,7 +74,7 @@ public class FlvRealtimeStreamRelay extends StreamRelay {
|
|
|
byte[] initAudioSegment = getChannelInitAudioSegment(channelId);
|
|
|
|
|
|
// 补发最近的I帧
|
|
|
- byte[] recentIFrame = getChannelRecentIFrame(channelId);
|
|
|
+ //byte[] recentIFrame = getChannelRecentIFrame(channelId);
|
|
|
|
|
|
// 在对应的Channel线程中发送,避免跨线程操作Channel引起的问题
|
|
|
ch.eventLoop().execute(() -> {
|
|
|
@@ -85,9 +87,9 @@ public class FlvRealtimeStreamRelay extends StreamRelay {
|
|
|
ch.writeAndFlush(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(initAudioSegment)));
|
|
|
}
|
|
|
|
|
|
- if (recentIFrame != null && recentIFrame.length > 0) {
|
|
|
- ch.writeAndFlush(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(recentIFrame)));
|
|
|
- }
|
|
|
+ // if (recentIFrame != null && recentIFrame.length > 0) {
|
|
|
+ // ch.writeAndFlush(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(recentIFrame)));
|
|
|
+ // }
|
|
|
});
|
|
|
|
|
|
// 最后再注册通道连接
|