]> git.basschouten.com Git - openhab-addons.git/commitdiff
[ipcamera] Fix orphan ffmpeg process after stopping stream URL (#14909)
authortb4jc <tb4jc@users.noreply.github.com>
Mon, 8 May 2023 09:43:49 +0000 (11:43 +0200)
committerGitHub <noreply@github.com>
Mon, 8 May 2023 09:43:49 +0000 (11:43 +0200)
* Setting ffmpeg reference 'ffmpegMjpeg' to null after stopping convertion to fix automatic restart of ffmpeg process.

---------

Signed-off-by: Thomas Burri <th@thonojato.ch>
bundles/org.openhab.binding.ipcamera/src/main/java/org/openhab/binding/ipcamera/internal/servlet/CameraServlet.java

index 4868ed050b71c34bdbb4b4859780802b464fd3d5..cfe098586458eeae7afbd8d2a8f187d297e89699 100644 (file)
@@ -212,6 +212,9 @@ public class CameraServlet extends IpCameraServlet {
                                 Ffmpeg localMjpeg = handler.ffmpegMjpeg;
                                 if (localMjpeg != null) {
                                     localMjpeg.stopConverting();
+                                    // Set reference to ffmpegMjpeg to null to prevent automatic reconnection
+                                    // in handler's pollCameraRunnable() check for frozen camera
+                                    handler.ffmpegMjpeg = null;
                                 }
                             } else {
                                 handler.closeChannel(handler.getTinyUrl(handler.mjpegUri));