diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-11-21 23:17:00 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-11-21 23:17:00 +0000 |
| commit | ad1ef39eda58b3a919ea3b7084401a0439409ec6 (patch) | |
| tree | 2bf2888a1a964f07b7dc318c7bf7dd73e1d61eb0 /src/lib/ffmpeg.cc | |
| parent | fe8251bb73765b459042b0fa841dae2d440487fd (diff) | |
Tidy and fix logging.
Diffstat (limited to 'src/lib/ffmpeg.cc')
| -rw-r--r-- | src/lib/ffmpeg.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 3bd08e84a..53829c5f2 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -24,6 +24,7 @@ #include "exceptions.h" #include "util.h" #include "log.h" +#include "dcpomatic_log.h" #include "ffmpeg_subtitle_stream.h" #include "ffmpeg_audio_stream.h" #include "digester.h" @@ -49,7 +50,6 @@ using boost::optional; using dcp::raw_convert; boost::mutex FFmpeg::_mutex; -boost::weak_ptr<Log> FFmpeg::_ffmpeg_log; FFmpeg::FFmpeg (boost::shared_ptr<const FFmpegContent> c) : _ffmpeg_content (c) @@ -97,14 +97,9 @@ FFmpeg::ffmpeg_log_callback (void* ptr, int level, const char* fmt, va_list vl) char line[1024]; static int prefix = 0; av_log_format_line (ptr, level, fmt, vl, line, sizeof (line), &prefix); - shared_ptr<Log> log = _ffmpeg_log.lock (); - if (log) { - string str (line); - boost::algorithm::trim (str); - log->log (String::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL); - } else { - cerr << line; - } + string str (line); + boost::algorithm::trim (str); + dcpomatic_log->log (String::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL); } void |
