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 {
9
9
10
10
/* *
11
11
* @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.
15
15
* @ingroup codecs
16
16
* @ingroup decoder
17
17
* @author Phil Schatzmann
18
18
* @copyright GPLv3
19
19
*/
20
20
class MultiDecoder : public AudioDecoder {
21
+ public:
21
22
// / Enables the automatic mime type determination
22
23
bool begin () override {
23
24
mime_detector.begin ();
@@ -42,7 +43,8 @@ class MultiDecoder : public AudioDecoder {
42
43
decoders.push_back (info);
43
44
}
44
45
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
46
48
bool selectDecoder (const char * mime) {
47
49
bool result = false ;
48
50
// do nothing if no change
@@ -88,6 +90,8 @@ class MultiDecoder : public AudioDecoder {
88
90
mime_detector.setMimeDetector (mimeDetectCallback);
89
91
}
90
92
93
+ virtual operator bool () { return is_first || actual_decoder.is_open ; };
94
+
91
95
protected:
92
96
struct DecoderInfo {
93
97
const char * mime = nullptr ;
You can’t perform that action at this time.
0 commit comments