/*
-Copyright (c) 2005-2009, John Hurst
+Copyright (c) 2005-2018, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
{
ui16_t format = KM_i16_LE(*(ui16_t*)p); p += 2;
- if ( format != WAVE_FORMAT_PCM && format != WAVE_FORMAT_EXTENSIBLE )
+ if ( format != ASDCP_WAVE_FORMAT_PCM && format != ASDCP_WAVE_FORMAT_EXTENSIBLE )
{
DefaultLogSink().Error("Expecting uncompressed PCM data, got format type %hd\n", format);
return RESULT_RAW_FORMAT;
ui32_t write_count = 0;
ui64_t RIFF_len = data_len + SimpleWavHeaderLength - 8;
- DefaultLogSink().Debug("RIFF_len is %llu.\n", RIFF_len);
+ // DefaultLogSink().Debug("RIFF_len is %llu.\n", RIFF_len);
byte_t* tmp_header = NULL;
ui32_t header_len = 0;
if ( test_fcc == Wav::FCC_data )
{
- if ( chunk_size > RIFF_len )
- {
- DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
- return RESULT_RAW_FORMAT;
- }
+ if ( chunk_size != MAX_RIFF_LEN )
+ {
+ if ( chunk_size > RIFF_len )
+ {
+ DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
+ return RESULT_RAW_FORMAT;
+ }
- if (chunk_size != MAX_RIFF_LEN)
data_len = chunk_size;
+ }
+
*data_start = p - buf;
break;
}
{
ui16_t format = KM_i16_LE(*(ui16_t*)p); p += 2;
- if ( format != Wav::WAVE_FORMAT_PCM && format != Wav::WAVE_FORMAT_EXTENSIBLE )
+ if ( format != Wav::ASDCP_WAVE_FORMAT_PCM && format != Wav::ASDCP_WAVE_FORMAT_EXTENSIBLE )
{
DefaultLogSink().Error("Expecting uncompressed PCM data, got format type %hd\n", format);
return RESULT_RAW_FORMAT;