648540858
2022-03-07 b2c953fc76de2a9686ee81d5311bd9b06e453912
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -160,19 +160,21 @@
    }
    @Override
    public void closeRTPServer(Device device, String channelId) {
        String mediaServerId = streamSession.getMediaServerId(device.getDeviceId(), channelId);
    public void closeRTPServer(String deviceId, String channelId, String stream) {
        String mediaServerId = streamSession.getMediaServerId(deviceId, channelId, stream);
        String ssrc = streamSession.getSSRC(deviceId, channelId, stream);
        MediaServerItem mediaServerItem = this.getOne(mediaServerId);
        if (mediaServerItem != null) {
            String streamId = String.format("%s_%s", device.getDeviceId(), channelId);
            String streamId = String.format("%s_%s", deviceId, channelId);
            zlmrtpServerFactory.closeRTPServer(mediaServerItem, streamId);
            releaseSsrc(mediaServerItem, streamSession.getSSRC(device.getDeviceId(), channelId));
            releaseSsrc(mediaServerItem.getId(), ssrc);
        }
        streamSession.remove(device.getDeviceId(), channelId);
        streamSession.remove(deviceId, channelId, stream);
    }
    @Override
    public void releaseSsrc(MediaServerItem mediaServerItem, String ssrc) {
    public void releaseSsrc(String mediaServerItemId, String ssrc) {
        MediaServerItem mediaServerItem = getOne(mediaServerItemId);
        if (mediaServerItem == null || ssrc == null) {
            return;
        }