From 0adb1ade91ca0504164a52801d878a0028381572 Mon Sep 17 00:00:00 2001 From: Dennis Hamester Date: Thu, 10 Nov 2016 11:33:56 +0100 Subject: [PATCH] Pass channel name to rtsp_client --- src/client.cpp | 2 +- src/rtsp_client.cpp | 5 ++++- src/rtsp_client.hpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index c0eeec0..e614288 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -249,7 +249,7 @@ PVR_ERROR UpdateTimer(const PVR_TIMER& timer) { return PVR_ERROR_NOT_IMPLEMENTED /* entirely unused, as we use standard RTSP+TS mux, which can be handlded by * Kodi core */ bool OpenLiveStream(const PVR_CHANNEL& channel) { - return rtsp_open(data->getUrl(channel.iUniqueId)); + return rtsp_open(data->getName(channel.iUniqueId), data->getUrl(channel.iUniqueId)); } int ReadLiveStream(unsigned char* pBuffer, unsigned int iBufferSize) { diff --git a/src/rtsp_client.cpp b/src/rtsp_client.cpp index 4dfe136..734a103 100644 --- a/src/rtsp_client.cpp +++ b/src/rtsp_client.cpp @@ -75,6 +75,7 @@ struct rtsp_client { size_t fifo_size; uint16_t last_seq_nr; + string name; int level; int quality; }; @@ -291,7 +292,7 @@ static enum rtsp_result rtsp_handle() { return (enum rtsp_result)rtsp_result; } -bool rtsp_open(const string& url_str) +bool rtsp_open(const string& name, const string& url_str) { string setup_url_str; const char *psz_setup_url; @@ -304,6 +305,7 @@ bool rtsp_open(const string& url_str) if (rtsp == NULL) return false; + rtsp->name = name; rtsp->level = 0; rtsp->quality = 0; @@ -471,6 +473,7 @@ void rtsp_close() void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status) { if(rtsp) { + strncpy(signal_status.strServiceName, rtsp->name.c_str(), PVR_ADDON_NAME_STRING_LENGTH - 1); signal_status.iSNR = 0x1111 * rtsp->quality; signal_status.iSignal = 0x101 * rtsp->level; } diff --git a/src/rtsp_client.hpp b/src/rtsp_client.hpp index e839973..04ced37 100644 --- a/src/rtsp_client.hpp +++ b/src/rtsp_client.hpp @@ -4,7 +4,7 @@ #include #include -bool rtsp_open(const std::string& url_str); +bool rtsp_open(const std::string& name, const std::string& url_str); void rtsp_close(); int rtsp_read(void *buf, unsigned buf_size); void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status);