Un-hard-wire bytes per sample slightly.
[dcpomatic.git] / src / lib / film_state.cc
index 343e9ebb4f4c4305e9f26e60b393c618d9fd973f..0b16f41753d73d9c4146a8e7dabdebfab86416da 100644 (file)
@@ -266,3 +266,17 @@ FilmState::content_type () const
 
        return VIDEO;
 }
+
+/** @return Number of bytes per sample of a single channel */
+int
+FilmState::bytes_per_sample () const
+{
+       switch (audio_sample_format) {
+       case AV_SAMPLE_FMT_S16:
+               return 2;
+       default:
+               assert (false);
+       }
+
+       assert (false);
+}