From 98437ce57e28015a0e82d688eed0f46151a6c365 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Tue, 2 Dec 2014 23:17:35 +0200 Subject: [PATCH] Fixed retuning. --- tuner.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tuner.c b/tuner.c index 621fd86..d17c81b 100644 --- a/tuner.c +++ b/tuner.c @@ -182,17 +182,18 @@ bool cSatipTuner::Connect(void) debug("cSatipTuner::%s() [device %d]", __FUNCTION__, deviceIdM); if (!isempty(*streamAddrM)) { - cString connectionUri = cString::sprintf("rtsp://%s/", *streamAddrM); - cString uri = cString::sprintf("%s?%s", *connectionUri, *streamParamM); + cString connectionUri = cString::sprintf("rtsp://%s", *streamAddrM); // Just retune if (streamIdM >= 0) { - debug("cSatipTuner::%s(): retune [device %d]", __FUNCTION__, deviceIdM); - if (rtspM.Setup(*uri, rtpM.Port(), rtcpM.Port())) { + cString uri = cString::sprintf("%s/stream=%d?%s", *connectionUri, streamIdM, *streamParamM); + debug("cSatipTuner::%s(): retuning [device %d]", __FUNCTION__, deviceIdM); + if (rtspM.Play(*uri)) { keepAliveM.Set(timeoutM); return true; } } else if (rtspM.Options(*connectionUri)) { + cString uri = cString::sprintf("%s/?%s", *connectionUri, *streamParamM); // Flush any old content rtpM.Flush(); rtcpM.Flush();