MCPcopy Create free account
hub / github.com/defold/defold / FindBestDecoder

Function FindBestDecoder

engine/sound/src/sound_decoder.cpp:51–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 }
50
51 const DecoderInfo* FindBestDecoder(Format format)
52 {
53 // All decoders contain a score, now pick the decoder with highest score
54 // with matching format.
55 int highest_score;
56 const DecoderInfo *best = 0;
57 const DecoderInfo *decoder = g_FirstDecoder;
58
59 while (decoder)
60 {
61 if (decoder->m_Format != format)
62 {
63 decoder = decoder->m_Next;
64 continue;
65 }
66
67 if (!best || decoder->m_Score > highest_score)
68 {
69 highest_score = decoder->m_Score;
70 best = decoder;
71 }
72
73 decoder = decoder->m_Next;
74 }
75 return best;
76 }
77
78 const char* ResultToString(Result result)
79 {

Callers 2

NewDecoderFunction · 0.85
RunSuiteMethod · 0.85

Calls

no outgoing calls

Tested by 1

RunSuiteMethod · 0.68