File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/AudioTools/AudioCodecs Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,16 @@ namespace audio_tools {
99
1010/* *
1111 * @brief Manage multiple decoders: the actual decoder is only opened when it
12- * has been selected. The relevant decoder is determined dynamically at the first
13- * write from the determined mime type. You can add your own custom mime type
14- * determination logic.
12+ * has been selected. The relevant decoder is determined dynamically at the
13+ * first write from the determined mime type. You can add your own custom mime
14+ * type determination logic.
1515 * @ingroup codecs
1616 * @ingroup decoder
1717 * @author Phil Schatzmann
1818 * @copyright GPLv3
1919 */
2020class MultiDecoder : public AudioDecoder {
21+ public:
2122 // / Enables the automatic mime type determination
2223 bool begin () override {
2324 mime_detector.begin ();
@@ -42,7 +43,8 @@ class MultiDecoder : public AudioDecoder {
4243 decoders.push_back (info);
4344 }
4445
45- // / selects the actual decoder by mime type - this is usually called automatically from the determined mime type
46+ // / selects the actual decoder by mime type - this is usually called
47+ // / automatically from the determined mime type
4648 bool selectDecoder (const char * mime) {
4749 bool result = false ;
4850 // do nothing if no change
@@ -88,6 +90,8 @@ class MultiDecoder : public AudioDecoder {
8890 mime_detector.setMimeDetector (mimeDetectCallback);
8991 }
9092
93+ virtual operator bool () { return is_first || actual_decoder.is_open ; };
94+
9195 protected:
9296 struct DecoderInfo {
9397 const char * mime = nullptr ;
You can’t perform that action at this time.
0 commit comments