READ_ME.TXT 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Praats/external/flac/READ_ME.TXT
  2. Paul Boersma, 18 December 2014
  3. This file describes the adaptations to the FLAC 1.2.1 sources
  4. that are needed to make them compatible with Praat.
  5. The .c and .h files are put into the single FLAC directory.
  6. The #include statements are flattened, e.g.
  7. #include private/float.h becomes #include flac_private_float.h.
  8. The FLaC__INLINE statement is turned into an inline statement
  9. in flac_share_alloc.h, and removed elsewhere (i.e. wherever there is a
  10. compiler message).
  11. For MinGW we need to change in flac_share_alloc.h:
  12. #if !defined _MSC_VER && !defined __EMX__
  13. #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */
  14. #endif
  15. The sources contain a confusion of FLAC__int32 and int,
  16. especially in calls to local_bitreader_read_rice_signed_block
  17. or FLAC__bitreader_read_rice_signed_block;
  18. Some changes from int to FLAC__int32 may be necessary.
  19. We also have to insert
  20. Melder_assert (sizeof (int) == 4)
  21. in read_residual_partitioned_rice_.
  22. To ensure compatibility with international file names on Windows,
  23. the following is added to flac_FLAC_formant.h:
  24. #ifdef _WIN32
  25. #include "melder.h"
  26. #define fopen(filename,mode) _wfopen (Melder_peekWcsToUtf16 (Melder_peekUtf8ToWcs (filename)), L"" mode)
  27. #endif
  28. There were two mistakes in FLAC__MD%Final () in flac_md5.c:
  29. memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
  30. if(0 != ctx->internal_buf) {
  31. free(ctx->internal_buf);
  32. ctx->internal_buf = 0;
  33. ctx->capacity = 0;
  34. }
  35. should be
  36. if(0 != ctx->internal_buf) { // test before clearing!
  37. free(ctx->internal_buf);
  38. ctx->internal_buf = 0;
  39. ctx->capacity = 0;
  40. }
  41. memset(ctx, 0, sizeof(*ctx)); // clear the whole structure, not just the first four or eight bytes!