Move audio sample format stuff out of Decoder base class.
authorCarl Hetherington <cth@carlh.net>
Wed, 7 Nov 2012 14:05:34 +0000 (14:05 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 7 Nov 2012 14:05:34 +0000 (14:05 +0000)
src/lib/decoder.cc
src/lib/decoder.h
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_decoder.h
src/lib/imagemagick_decoder.h
src/lib/tiff_decoder.cc
src/lib/tiff_decoder.h

index 09788cd0cb887599c939cf31439df9e23def8c9d..01c4edf604b9864e3f011d7a45afee81ffd47217 100644 (file)
@@ -243,9 +243,3 @@ Decoder::process_subtitle (shared_ptr<TimedSubtitle> s)
                _timed_subtitle->subtitle()->set_position (Position (p.x - _film->crop().left, p.y - _film->crop().top));
        }
 }
-
-int
-Decoder::bytes_per_audio_sample () const
-{
-       return av_get_bytes_per_sample (audio_sample_format ());
-}
index 30b7dd41f26666bd60672f18da6894c52a4d70ed..1807254dbc1c57a35154ad3a136b72bcd0ff4398 100644 (file)
@@ -65,8 +65,6 @@ public:
        virtual int audio_channels () const = 0;
        /** @return audio sampling rate in Hz */
        virtual int audio_sample_rate () const = 0;
-       /** @return format of audio samples */
-       virtual AVSampleFormat audio_sample_format () const = 0;
        virtual int64_t audio_channel_layout () const = 0;
        virtual bool has_subtitles () const = 0;
 
@@ -111,8 +109,6 @@ protected:
        void process_subtitle (boost::shared_ptr<TimedSubtitle>);
        void repeat_last_video ();
 
-       int bytes_per_audio_sample () const;
-       
        /** our Film */
        boost::shared_ptr<Film> _film;
        /** our options */
index e26de4adab1d75442510be1d51721e6b71de19bd..9d396f423dbfcd5c06b78d7621f6a25ba69e1816 100644 (file)
@@ -573,3 +573,8 @@ FFmpegDecoder::stream_name (AVStream* s) const
        return n.str ();
 }
 
+int
+FFmpegDecoder::bytes_per_audio_sample () const
+{
+       return av_get_bytes_per_sample (audio_sample_format ());
+}
index 5d278ea0d4ae627058729ea7c3b9ecae9f9390ea..8373125cd5a2b93ad5824dc4950d90bf27d27303 100644 (file)
@@ -60,7 +60,6 @@ public:
        Size native_size () const;
        int audio_channels () const;
        int audio_sample_rate () const;
-       AVSampleFormat audio_sample_format () const;
        int64_t audio_channel_layout () const;
        bool has_subtitles () const;
 
@@ -75,6 +74,8 @@ private:
        int time_base_denominator () const;
        int sample_aspect_ratio_numerator () const;
        int sample_aspect_ratio_denominator () const;
+       AVSampleFormat audio_sample_format () const;
+       int bytes_per_audio_sample () const;
 
        void setup_general ();
        void setup_video ();
index b7ab9af18119cf0c1677d3c6a0993f2b48335463..1bf50378bc3788bbc723f9c2ad79750582cd272f 100644 (file)
@@ -42,10 +42,6 @@ public:
                return 0;
        }
 
-       AVSampleFormat audio_sample_format () const {
-               return AV_SAMPLE_FMT_NONE;
-       }
-
        int64_t audio_channel_layout () const {
                return 0;
        }
index 7cca511dda884d0cdceb84178aea0030940f76fb..c92e080d7cdf0076abb4b36077739ccae05b9e8f 100644 (file)
@@ -114,13 +114,6 @@ TIFFDecoder::audio_sample_rate () const
        return 0;
 }
 
-AVSampleFormat
-TIFFDecoder::audio_sample_format () const
-{
-       return AV_SAMPLE_FMT_NONE;
-}
-
-
 int64_t
 TIFFDecoder::audio_channel_layout () const
 {
index 1c33443cf17518d5e636fca8f087a4260f61a153..e6821eec663e18b006eadaee24f00068f902087b 100644 (file)
@@ -49,7 +49,6 @@ public:
        Size native_size () const;
        int audio_channels () const;
        int audio_sample_rate () const;
-       AVSampleFormat audio_sample_format () const;
        int64_t audio_channel_layout () const;
        bool has_subtitles () const {
                return false;