Skip to content

Commit eb270c3

Browse files
committed
ContainerM4A: restore decoder after use
1 parent a51eca8 commit eb270c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/AudioTools/AudioCodecs/ContainerM4A.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ class ContainerM4A : public ContainerDecoder {
106106
return;
107107
}
108108
MultiDecoder& dec = *(self->p_decoder);
109+
const char* current_mime = dec.selectedMime();
110+
109111
// select decoder based on mime type
110112
if (!dec.selectDecoder(frame.mime)) {
111113
const char* mime = frame.mime ? frame.mime : "(nullptr)";
@@ -126,6 +128,9 @@ class ContainerM4A : public ContainerDecoder {
126128
}
127129
// write encoded data to decoder
128130
dec.write(frame.data, frame.size);
131+
132+
// restore the original mime type
133+
dec.selectDecoder(current_mime)
129134
}
130135
};
131136

0 commit comments

Comments
 (0)