Skip to content

Commit 15bbc0d

Browse files
committed
AudioBuffer: comment explaining the try/catch in __getCodec around bytes.getString()
Followup to commit 9b2be25
1 parent 9b2be25 commit 15bbc0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lime/media/AudioBuffer.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,12 @@ class AudioBuffer
424424
{
425425
signature = bytes.getString(0, 4);
426426
}
427-
catch (e:Dynamic) {}
427+
catch (e:Dynamic)
428+
{
429+
// if the bytes don't represent a valid UTF-8 string, getString()
430+
// may throw an exception. in that case, we expect to end up in
431+
// the default switch case below where it tries to detect MP3.
432+
}
428433

429434
switch (signature)
430435
{

0 commit comments

Comments
 (0)