diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/audio_decoder_stream.cc | 6 | ||||
| -rw-r--r-- | src/lib/config.cc | 2 | ||||
| -rw-r--r-- | src/lib/log.cc | 10 | ||||
| -rw-r--r-- | src/lib/log.h | 2 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 6 | ||||
| -rw-r--r-- | src/lib/writer.cc | 16 |
6 files changed, 18 insertions, 24 deletions
diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc index 8c521f94d..fdcebbc9f 100644 --- a/src/lib/audio_decoder_stream.cc +++ b/src/lib/audio_decoder_stream.cc @@ -23,6 +23,8 @@ #include "audio_decoder.h" #include "resampler.h" #include "util.h" +#include "film.h" +#include "log.h" #include <iostream> #include "i18n.h" @@ -58,6 +60,8 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate) { shared_ptr<ContentAudio> dec; + _content->film()->log()->log (String::compose ("ADS has request for %1 %2", frame, length), Log::TYPE_DEBUG_DECODE); + Frame const end = frame + length - 1; if (frame < _decoded.frame || end > (_decoded.frame + length * 4)) { @@ -130,6 +134,8 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate) void AudioDecoderStream::audio (shared_ptr<const AudioBuffers> data, ContentTime time) { + _content->film()->log()->log (String::compose ("ADS receives %1 %2", time, data->frames ()), Log::TYPE_DEBUG_DECODE); + if (_resampler) { data = _resampler->run (data); } diff --git a/src/lib/config.cc b/src/lib/config.cc index e6f363729..ee38e9866 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -78,7 +78,7 @@ Config::set_defaults () _check_for_updates = false; _check_for_test_updates = false; _maximum_j2k_bandwidth = 250000000; - _log_types = Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR | Log::TYPE_DEBUG; + _log_types = Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR; #ifdef DCPOMATIC_WINDOWS _win32_console = false; #endif diff --git a/src/lib/log.cc b/src/lib/log.cc index 42184ec45..d9696f3cc 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -32,11 +32,11 @@ using namespace std; -int const Log::TYPE_GENERAL = 0x1; -int const Log::TYPE_WARNING = 0x2; -int const Log::TYPE_ERROR = 0x4; -int const Log::TYPE_DEBUG = 0x8; -int const Log::TYPE_TIMING = 0x10; +int const Log::TYPE_GENERAL = 0x1; +int const Log::TYPE_WARNING = 0x2; +int const Log::TYPE_ERROR = 0x4; +int const Log::TYPE_DEBUG_DECODE = 0x8; +int const Log::TYPE_TIMING = 0x10; Log::Log () : _types (0) diff --git a/src/lib/log.h b/src/lib/log.h index 1b7cef038..6803f8d59 100644 --- a/src/lib/log.h +++ b/src/lib/log.h @@ -42,7 +42,7 @@ public: static const int TYPE_GENERAL; static const int TYPE_WARNING; static const int TYPE_ERROR; - static const int TYPE_DEBUG; + static const int TYPE_DEBUG_DECODE; static const int TYPE_TIMING; void log (std::string message, int type); diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index fcc262163..cdf8bc12a 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -75,6 +75,8 @@ VideoDecoder::get_video (Frame frame, bool accurate) one after the end of _decoded_video we need to seek. */ + _video_content->film()->log()->log (String::compose ("VD has request for %1", frame), Log::TYPE_DEBUG_DECODE); + if (_decoded_video.empty() || frame < _decoded_video.front().frame || frame > (_decoded_video.back().frame + 1)) { seek (ContentTime::from_frames (frame, _video_content->video_frame_rate()), accurate); } @@ -233,6 +235,8 @@ VideoDecoder::video (shared_ptr<const ImageProxy> image, Frame frame) return; } + _video_content->film()->log()->log (String::compose ("VD receives %1", frame), Log::TYPE_DEBUG_DECODE); + /* We may receive the same frame index twice for 3D, and we need to know when that happens. */ diff --git a/src/lib/writer.cc b/src/lib/writer.cc index ae1fb3e87..7099f51c2 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -59,8 +59,6 @@ #define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_WARNING); #define LOG_WARNING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_WARNING); #define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); -#define LOG_DEBUG(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_DEBUG); -#define LOG_DEBUG_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_DEBUG); /* OS X strikes again */ #undef set_key @@ -314,9 +312,6 @@ try { boost::mutex::scoped_lock lock (_mutex); - /* This is for debugging only */ - bool done_something = false; - while (true) { if (_finish || _queued_full_in_memory > _maximum_frames_in_memory || have_sequenced_image_at_queue_head ()) { @@ -340,7 +335,6 @@ try _finish is true). */ if (_finish && (!have_sequenced_image_at_queue_head() || _queue.empty())) { - done_something = true; /* (Hopefully temporarily) log anything that was not written */ if (!_queue.empty() && !have_sequenced_image_at_queue_head()) { LOG_WARNING (N_("Finishing writer with a left-over queue of %1:"), _queue.size()); @@ -357,7 +351,6 @@ try } /* Write any frames that we can write; i.e. those that are in sequence. */ while (have_sequenced_image_at_queue_head ()) { - done_something = true; QueueItem qi = _queue.front (); _queue.pop_front (); if (qi.type == QueueItem::FULL && qi.encoded) { @@ -415,7 +408,6 @@ try } while (_queued_full_in_memory > _maximum_frames_in_memory) { - done_something = true; /* Too many frames in memory which can't yet be written to the stream. Write some FULL frames to disk. */ @@ -449,14 +441,6 @@ try --_queued_full_in_memory; } - if (!done_something) { - LOG_DEBUG_NC ("Writer loop ran without doing anything"); - LOG_DEBUG ("_queued_full_in_memory=%1", _queued_full_in_memory); - LOG_DEBUG ("_queue_size=%1", _queue.size ()); - LOG_DEBUG ("_finish=%1", _finish); - LOG_DEBUG ("_last_written_frame=%1", _last_written_frame); - } - /* The queue has probably just gone down a bit; notify anything wait()ing on _full_condition */ _full_condition.notify_all (); } |
