Skip to content

Commit

Permalink
Merge pull request #8 from phunkyfish/logging-cleanup
Browse files Browse the repository at this point in the history
cleanup logging
  • Loading branch information
phunkyfish authored Jan 30, 2020
2 parents 80d5e33 + 42d06e7 commit a8615fb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
5 changes: 4 additions & 1 deletion inputstream.ffmpegdirect/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="inputstream.ffmpegdirect"
version="1.4.0"
version="1.4.1"
name="Inputstream FFmpeg Direct"
provider-name="phunkyfish">
<requires>@ADDON_DEPENDS@</requires>
Expand All @@ -17,6 +17,9 @@
<description lang="en_GB">InputStream Client for streams that can be opened by FFmpeg's libavformat such as plain TS, HLS and DASH (without DRM) streams.&#10; &#10;The addon also has support for Archive/Catchup services where there is a replay windows (usually in days) and can timeshift across that span.&#10; &#10;For documenation visit: https://github.com/xbmc/inputstream.ffmpegdirect/blob/Matrix/README.md&#10; </description>
<platform>@PLATFORM@</platform>
<news>
v1.4.1
- Update: Cleanup logging

v1.4.0
- Added: gnutls patch to add libdl to support newer OSes
- Added: Add support for mms and rtp/udp streams with sources
Expand Down
3 changes: 3 additions & 0 deletions inputstream.ffmpegdirect/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.4.1
- Update: Cleanup logging

v1.4.0
- Added: gnutls patch to add libdl to support newer OSes
- Added: Add support for mms and rtp/udp streams with sources
Expand Down
2 changes: 1 addition & 1 deletion src/StreamManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void CInputStreamLibavformat::DemuxSetSpeed(int speed)

void CInputStreamLibavformat::SetVideoResolution(int width, int height)
{
Log(LOGLEVEL_NOTICE, "inputstream.ffmpegdirect: SetVideoResolution()");
Log(LOGLEVEL_DEBUG, "inputstream.ffmpegdirect: SetVideoResolution()");

m_videoWidth = width;
m_videoHeight = height;
Expand Down
18 changes: 9 additions & 9 deletions src/stream/FFmpegCatchupStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ int64_t FFmpegCatchupStream::SeekStream(int64_t position, int whence /* SEEK_SET
int64_t ret = -1;
if (m_catchupBufferStartTime > 0)
{
Log(LOGLEVEL_NOTICE, "SeekLiveStream - iPosition = %lld, iWhence = %d", position, whence);
Log(LOGLEVEL_DEBUG, "SeekLiveStream - iPosition = %lld, iWhence = %d", position, whence);
const time_t timeNow = time(0);
switch (whence)
{
case SEEK_SET:
{
Log(LOGLEVEL_NOTICE, "SeekLiveStream - SeekSet: %lld", static_cast<long long>(position));
Log(LOGLEVEL_DEBUG, "SeekLiveStream - SeekSet: %lld", static_cast<long long>(position));
position += 500;
position /= 1000;
if (m_catchupBufferStartTime + position < timeNow - 10)
Expand All @@ -170,12 +170,12 @@ int64_t FFmpegCatchupStream::SeekStream(int64_t position, int whence /* SEEK_SET
case SEEK_CUR:
{
int64_t offset = m_catchupBufferOffset;
//Log(LOGLEVEL_NOTICE, "SeekLiveStream - timeNow = %d, startTime = %d, iTvgShift = %d, offset = %d", timeNow, m_catchupStartTime, m_programmeChannelTvgShift, offset);
//Log(LOGLEVEL_DEBUG, "SeekLiveStream - timeNow = %d, startTime = %d, iTvgShift = %d, offset = %d", timeNow, m_catchupStartTime, m_programmeChannelTvgShift, offset);
ret = offset * DVD_TIME_BASE;
}
break;
default:
Log(LOGLEVEL_NOTICE, "SeekLiveStream - Unsupported SEEK command (%d)", whence);
Log(LOGLEVEL_DEBUG, "SeekLiveStream - Unsupported SEEK command (%d)", whence);
break;
}
}
Expand All @@ -192,7 +192,7 @@ int64_t FFmpegCatchupStream::LengthStream()
length = static_cast<int64_t>(times.ptsEnd - times.ptsBegin);
}

Log(LOGLEVEL_NOTICE, "LengthLiveStream: %lld", static_cast<long long>(length));
Log(LOGLEVEL_DEBUG, "LengthLiveStream: %lld", static_cast<long long>(length));

return length;
}
Expand All @@ -211,9 +211,9 @@ bool FFmpegCatchupStream::GetTimes(INPUTSTREAM_TIMES& times)
else // it's like a video
times.ptsEnd = static_cast<double>(std::min(dateTimeNow, m_catchupBufferEndTime) - times.startTime) * DVD_TIME_BASE;

// Log(LOGLEVEL_NOTICE, "GetStreamTimes - Ch = %u \tTitle = \"%s\" \tepgTag->startTime = %ld \tepgTag->endTime = %ld",
// Log(LOGLEVEL_DEBUG, "GetStreamTimes - Ch = %u \tTitle = \"%s\" \tepgTag->startTime = %ld \tepgTag->endTime = %ld",
// m_programmeUniqueChannelId, m_programmeTitle.c_str(), m_catchupBufferStartTime, m_catchupBufferEndTime);
Log(LOGLEVEL_NOTICE, "GetStreamTimes - startTime = %ld \tptsStart = %lld \tptsBegin = %lld \tptsEnd = %lld",
Log(LOGLEVEL_DEBUG, "GetStreamTimes - startTime = %ld \tptsStart = %lld \tptsBegin = %lld \tptsEnd = %lld",
times.startTime, static_cast<long long>(times.ptsStart), static_cast<long long>(times.ptsBegin), static_cast<long long>(times.ptsEnd));

return true;
Expand Down Expand Up @@ -312,7 +312,7 @@ std::string FormatDateTime(time_t dateTimeEpg, time_t duration, const std::strin
FormatUtc("{duration}", duration, fomrattedUrl);
FormatOffset(dateTimeNow - dateTimeEpg, fomrattedUrl);

Log(LOGLEVEL_NOTICE, "CArchiveConfig::FormatDateTime - \"%s\"", fomrattedUrl.c_str());
Log(LOGLEVEL_DEBUG, "CArchiveConfig::FormatDateTime - \"%s\"", fomrattedUrl.c_str());

return fomrattedUrl;
}
Expand All @@ -330,7 +330,7 @@ std::string FFmpegCatchupStream::GetUpdatedCatchupUrl() const
if (m_programmeStartTime > 0 && m_programmeStartTime < m_programmeEndTime)
duration = m_programmeEndTime - m_programmeStartTime;

Log(LOGLEVEL_NOTICE, "Offset Time - \"%lld\" - %s", static_cast<long long>(offset), m_catchupUrlFormatString.c_str());
Log(LOGLEVEL_DEBUG, "Offset Time - \"%lld\" - %s", static_cast<long long>(offset), m_catchupUrlFormatString.c_str());

std::string catchupUrl = FormatDateTime(offset - m_timezoneShift, duration, m_catchupUrlFormatString);
if (!catchupUrl.empty())
Expand Down
5 changes: 1 addition & 4 deletions src/stream/FFmpegStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ bool FFmpegStream::Open(const std::string& streamUrl, const std::string& mimeTyp
// checkStreamInfo = false;
// }

Log(LOGLEVEL_NOTICE, "AttemptOpen");
m_opened = Open(checkStreamInfo);
Log(LOGLEVEL_NOTICE, "AttemptOpen %d", m_opened);

return m_opened;
}
Expand Down Expand Up @@ -187,7 +185,7 @@ INPUTSTREAM_INFO FFmpegStream::GetStream(int streamid)
0, 0, 0, 0, 0,
CRYPTO_INFO::CRYPTO_KEY_SYSTEM_NONE ,0 ,0 ,0};

Log(LOGLEVEL_NOTICE, "GetStream(%d)", streamid);
Log(LOGLEVEL_DEBUG, "GetStream(%d)", streamid);

DemuxStream* stream = nullptr;
auto streamPair = m_streams.find(streamid);
Expand Down Expand Up @@ -308,7 +306,6 @@ DemuxPacket* FFmpegStream::DemuxRead()

if (IsProgramChange())
{
Log(LOGLEVEL_NOTICE, "CDVDDemuxFFmpeg::Read() stream change XXXXX");
av_dump_format(m_pFormatContext, 0, CURL::GetRedacted(m_streamUrl).c_str(), 0);

// update streams
Expand Down
2 changes: 1 addition & 1 deletion src/stream/commons/Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace XbmcCommons

void Exception::LogThrowMessage(const char* prefix) const
{
Log(LOGLEVEL_ERROR,"EXCEPTION Thrown (%s) : %s", classname.c_str(), message.c_str());
Log(LOGLEVEL_ERROR, "EXCEPTION Thrown (%s) : %s", classname.c_str(), message.c_str());
}
}

0 comments on commit a8615fb

Please sign in to comment.