diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-25 00:06:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-25 00:06:47 +0100 |
| commit | 913b1ae68f8e953ff2323b6b7f86cd515c2592d0 (patch) | |
| tree | 4d1629421e584341f389248c4983f5e5af00fae3 /src/lib | |
| parent | 110d7d4e111c2db31489296587d855328c5d8b34 (diff) | |
Erroneous leftover _log in Decoder; use decoder audio channels count rather than Film's.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/decoder.cc | 12 | ||||
| -rw-r--r-- | src/lib/decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index eee288341..e2e151cb7 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -114,7 +114,7 @@ Decoder::process_end () int64_t const video_length_in_audio_frames = ((int64_t) last_video_frame() * audio_sample_rate() / frames_per_second()); int64_t const audio_short_by_frames = video_length_in_audio_frames - _audio_frames_processed; - _log->log ( + _film->log()->log ( String::compose ("DCP length is %1 (%2 audio frames); %3 frames of audio processed.", last_video_frame(), video_length_in_audio_frames, @@ -123,8 +123,8 @@ Decoder::process_end () if (audio_short_by_frames >= 0 && _opt->decode_audio) { - _log->log (String::compose ("DCP length is %1; %2 frames of audio processed.", last_video_frame(), _audio_frames_processed)); - _log->log (String::compose ("Adding %1 frames of silence to the end.", audio_short_by_frames)); + _film->log()->log (String::compose ("DCP length is %1; %2 frames of audio processed.", last_video_frame(), _audio_frames_processed)); + _film->log()->log (String::compose ("Adding %1 frames of silence to the end.", audio_short_by_frames)); /* XXX: this is slightly questionable; does memset () give silence with all sample formats? @@ -200,11 +200,11 @@ Decoder::emit_audio (uint8_t* data, int size) { /* Deinterleave and convert to float */ - assert ((size % (bytes_per_audio_sample() * _film->audio_channels())) == 0); + assert ((size % (bytes_per_audio_sample() * audio_channels())) == 0); int const total_samples = size / bytes_per_audio_sample(); int const frames = total_samples / _film->audio_channels(); - shared_ptr<AudioBuffers> audio (new AudioBuffers (_film->audio_channels(), frames)); + shared_ptr<AudioBuffers> audio (new AudioBuffers (audio_channels(), frames)); switch (audio_sample_format()) { case AV_SAMPLE_FMT_S16: @@ -438,7 +438,7 @@ Decoder::setup_video_filters () inputs->pad_idx = 0; inputs->next = 0; - _log->log ("Using filter chain `" + filters + "'"); + _film->log()->log ("Using filter chain `" + filters + "'"); #if LIBAVFILTER_VERSION_MAJOR == 2 && LIBAVFILTER_VERSION_MINOR == 15 if (avfilter_graph_parse (graph, filters.c_str(), inputs, outputs, 0) < 0) { diff --git a/src/lib/decoder.h b/src/lib/decoder.h index 39eaaf48e..7940aed6c 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -118,8 +118,6 @@ protected: boost::shared_ptr<const Options> _opt; /** associated Job, or 0 */ Job* _job; - /** log that we can write to */ - Log* _log; /** true to do the bare minimum of work; just run through the content. Useful for acquiring * accurate frame counts as quickly as possible. This generates no video or audio output. diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index b6cdce0e4..034fefeb2 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -275,7 +275,7 @@ FFmpegDecoder::do_pass () /* frames of silence that we must push */ int const s = rint ((_first_audio.get() - _first_video.get()) * audio_sample_rate ()); - _log->log ( + _film->log()->log ( String::compose ( "First video at %1, first audio at %2, pushing %3 frames of silence for %4 channels (%5 bytes per sample)", _first_video.get(), _first_audio.get(), s, audio_channels(), bytes_per_audio_sample() |
