Ignore:
Timestamp:
02/16/09 22:33:42 (16 years ago)
Author:
r2d
Message:

check streaminfo values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/trunk/libmpcdec/streaminfo.c

    r390 r425  
    5151    "'BrainDead'", "'quality 9'", "'quality 10'"
    5252};
    53 static const mpc_int32_t samplefreqs[4] = { 44100, 48000, 37800, 32000 };
     53static const mpc_int32_t samplefreqs[8] = { 44100, 48000, 37800, 32000 };
    5454
    5555static const char *
     
    9797}
    9898
     99static mpc_status check_streaminfo(mpc_streaminfo * si)
     100{
     101        if (si->max_band == 0 || si->max_band > 32
     102            || si->channels > 2)
     103                return MPC_STATUS_FILE;
     104        return MPC_STATUS_OK;
     105}
     106
    99107/// Reads streaminfo from SV7 header.
    100108mpc_status
     
    157165                        *  si->sample_freq / si->samples;
    158166
    159     return MPC_STATUS_OK;
     167        return check_streaminfo(si);
    160168}
    161169
     
    206214                                *  si->sample_freq / (si->samples - si->beg_silence);
    207215
    208         return MPC_STATUS_OK;
     216        return check_streaminfo(si);
    209217}
    210218
Note: See TracChangeset for help on using the changeset viewer.