| 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 | { |
no outgoing calls