From: Carl Hetherington Date: Wed, 7 Nov 2012 14:05:34 +0000 (+0000) Subject: Move audio sample format stuff out of Decoder base class. X-Git-Tag: v2.0.48~1547 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=5c225839172ce9f0a9be81dabfbbeb3190a9ff20;p=dcpomatic.git Move audio sample format stuff out of Decoder base class. --- diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 09788cd0c..01c4edf60 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -243,9 +243,3 @@ Decoder::process_subtitle (shared_ptr 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 ()); -} diff --git a/src/lib/decoder.h b/src/lib/decoder.h index 30b7dd41f..1807254db 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -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); void repeat_last_video (); - int bytes_per_audio_sample () const; - /** our Film */ boost::shared_ptr _film; /** our options */ diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index e26de4ada..9d396f423 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -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 ()); +} diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index 5d278ea0d..8373125cd 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -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 (); diff --git a/src/lib/imagemagick_decoder.h b/src/lib/imagemagick_decoder.h index b7ab9af18..1bf50378b 100644 --- a/src/lib/imagemagick_decoder.h +++ b/src/lib/imagemagick_decoder.h @@ -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; } diff --git a/src/lib/tiff_decoder.cc b/src/lib/tiff_decoder.cc index 7cca511dd..c92e080d7 100644 --- a/src/lib/tiff_decoder.cc +++ b/src/lib/tiff_decoder.cc @@ -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 { diff --git a/src/lib/tiff_decoder.h b/src/lib/tiff_decoder.h index 1c33443cf..e6821eec6 100644 --- a/src/lib/tiff_decoder.h +++ b/src/lib/tiff_decoder.h @@ -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;