Skip to content

Commit

Permalink
Merge pull request #12496 from pkerling/ffmpeg-filter-log
Browse files Browse the repository at this point in the history
Log filter graph only when video component logging is enabled
  • Loading branch information
Rechi committed Jul 14, 2017
2 parents 579e978 + 6d028fc commit 0f6a753
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
Expand Up @@ -1149,11 +1149,14 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const std::string& filters, bool scale)
return result;
}

char* graphDump = avfilter_graph_dump(m_pFilterGraph, nullptr);
if (graphDump)
if (g_advancedSettings.CanLogComponent(LOGVIDEO))
{
CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg::FilterOpen - Final filter graph:\n%s", graphDump);
av_freep(&graphDump);
char* graphDump = avfilter_graph_dump(m_pFilterGraph, nullptr);
if (graphDump)
{
CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg::FilterOpen - Final filter graph:\n%s", graphDump);
av_freep(&graphDump);
}
}

m_filterEof = false;
Expand All @@ -1164,7 +1167,10 @@ void CDVDVideoCodecFFmpeg::FilterClose()
{
if (m_pFilterGraph)
{
CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg::FilterClose - Freeing filter graph");
if (g_advancedSettings.CanLogComponent(LOGVIDEO))
{
CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg::FilterClose - Freeing filter graph");
}
avfilter_graph_free(&m_pFilterGraph);

// Disposed by above code
Expand Down

0 comments on commit 0f6a753

Please sign in to comment.