Erroneous leftover _log in Decoder; use decoder audio channels count rather than...
authorCarl Hetherington <cth@carlh.net>
Wed, 24 Oct 2012 23:06:47 +0000 (00:06 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 24 Oct 2012 23:06:47 +0000 (00:06 +0100)
src/lib/decoder.cc
src/lib/decoder.h
src/lib/ffmpeg_decoder.cc

index eee288341d728fdc04d72d41157de1563381171a..e2e151cb79a9dcfb31a5c6e4702798a6d7c5d4c1 100644 (file)
@@ -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) {
index 39eaaf48ed4c737dd2c63f43b303d19079033acf..7940aed6cdbf71921a48c591f8429ea21ea60900 100644 (file)
@@ -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.
index b6cdce0e436e53715f28076a46e5d86d3a558885..034fefeb2cd37215e0bba8c9a3d757f999f0442e 100644 (file)
@@ -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()