Fix mjpeg wont open multiple streams when port is not 80 (#13502)
Signed-off-by: Matthew Skinner <matt@pcmus.com>
This commit is contained in:
@@ -1406,7 +1406,7 @@ public class IpCameraHandler extends BaseThingHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean streamIsStopped(String url) {
|
private boolean streamIsStopped(String url) {
|
||||||
ChannelTracking channelTracking = channelTrackingMap.get(url);
|
ChannelTracking channelTracking = channelTrackingMap.get(url);
|
||||||
if (channelTracking != null) {
|
if (channelTracking != null) {
|
||||||
if (channelTracking.getChannel().isActive()) {
|
if (channelTracking.getChannel().isActive()) {
|
||||||
@@ -1732,7 +1732,9 @@ public class IpCameraHandler extends BaseThingHandler {
|
|||||||
localFfmpeg.stopConverting();
|
localFfmpeg.stopConverting();
|
||||||
ffmpegSnapshot = null;
|
ffmpegSnapshot = null;
|
||||||
}
|
}
|
||||||
onvifCamera.disconnect();
|
if (!thing.getThingTypeUID().getId().equals(GENERIC_THING)) {// generic cameras do not have ONVIF support
|
||||||
|
onvifCamera.disconnect();
|
||||||
|
}
|
||||||
openChannels.close();
|
openChannels.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,11 +187,10 @@ public class CameraServlet extends IpCameraServlet {
|
|||||||
if (handler.mjpegUri.isEmpty() || "ffmpeg".equals(handler.mjpegUri)) {
|
if (handler.mjpegUri.isEmpty() || "ffmpeg".equals(handler.mjpegUri)) {
|
||||||
output = new StreamOutput(resp);
|
output = new StreamOutput(resp);
|
||||||
} else {
|
} else {
|
||||||
ChannelTracking tracker = handler.channelTrackingMap.get(handler.mjpegUri);
|
ChannelTracking tracker = handler.channelTrackingMap.get(handler.getTinyUrl(handler.mjpegUri));
|
||||||
if (tracker == null || !tracker.getChannel().isOpen()) {
|
if (tracker == null || !tracker.getChannel().isOpen()) {
|
||||||
logger.debug("Not the first stream requested but the stream from camera was closed");
|
logger.debug("Not the first stream requested but the stream from camera was closed");
|
||||||
handler.openCamerasStream();
|
handler.openCamerasStream();
|
||||||
openStreams.closeAllStreams();
|
|
||||||
}
|
}
|
||||||
output = new StreamOutput(resp, handler.mjpegContentType);
|
output = new StreamOutput(resp, handler.mjpegContentType);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user