} ;
break ;
+ case JUNK_MARKER :
case PAD_MARKER :
psf_log_printf (psf, "%M : %d\n", marker, chunk_size) ;
psf_binheader_readf (psf, "j", chunk_size) ;
#endif
+ /* Padding may be needed if string data sizes change. */
pad_size = psf->dataoffset - 16 - psf->header.indx ;
if (pad_size >= 0)
psf_binheader_writef (psf, "m4z", PAD_MARKER, (unsigned int) pad_size, make_size_t (pad_size)) ;
static void
rf64_long_file_downgrade_test (const char *filename)
{ static int output [BUFFER_LEN] ;
+ static int input [1] = { 0 } ;
SNDFILE *file ;
SF_INFO sfinfo ;
- sf_count_t k, output_frames = 0 ;
+ sf_count_t output_frames = 0 ;
print_test_name (__func__, filename) ;
sf_info_clear (&sfinfo) ;
- for (k = 0 ; k < BUFFER_LEN ; k++)
- output [k] = 0x1020304 ;
+ memset (output, 0, sizeof (output)) ;
+ output [0] = 0x1020304 ;
sfinfo.samplerate = 44100 ;
sfinfo.frames = ARRAY_LEN (output) ;
exit_if_true (sfinfo.channels != 1, "\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ;
exit_if_true (sfinfo.frames != output_frames, "\n\nLine %d: Incorrect number of frames in file (%d should be %d).\n", __LINE__, (int) sfinfo.frames, (int) output_frames) ;
+ /* Check that the first sample read is the same as the first written. */
+ test_read_int_or_die (file, 0, input, ARRAY_LEN (input), __LINE__) ;
+ exit_if_true (input [0] != output [0], "\n\nLine %d: Bad first sample (0x%08x).\n", __LINE__, input [0]) ;
+
check_log_buffer_or_die (file, __LINE__) ;
sf_close (file) ;