summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-11-07 14:05:34 +0000
committerCarl Hetherington <cth@carlh.net>2012-11-07 14:05:34 +0000
commit5c225839172ce9f0a9be81dabfbbeb3190a9ff20 (patch)
tree774f7db3f4372f4d8facca71b61ad2740ba428c5 /src/lib
parent5ff6c5b412fcd63c1a4dad88d1535fb56e457b8e (diff)
Move audio sample format stuff out of Decoder base class.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/decoder.cc6
-rw-r--r--src/lib/decoder.h4
-rw-r--r--src/lib/ffmpeg_decoder.cc5
-rw-r--r--src/lib/ffmpeg_decoder.h3
-rw-r--r--src/lib/imagemagick_decoder.h4
-rw-r--r--src/lib/tiff_decoder.cc7
-rw-r--r--src/lib/tiff_decoder.h1
7 files changed, 7 insertions, 23 deletions
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<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 ());
-}
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<TimedSubtitle>);
void repeat_last_video ();
- int bytes_per_audio_sample () const;
-
/** our Film */
boost::shared_ptr<Film> _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;