mirror of
https://github.com/xiph/opus.git
synced 2025-05-29 06:39:15 +00:00
trivial_example: open raw pcm files in binary mode.
The simple codec round-trip example file in the doc directory opens an input and output pcm file. It was working fine on POSIX systems, but not on Windows, which treats text files differently. This is confusing in a example, so it's better to add an explicit binary flag to the fopen() calls. This does nothing on unix-like systems, but should make the example work for developers on Windows. Thanks to Wavesonics who reported this on irc. Signed-off-by: Mark Harris <mark.hsj@gmail.com>
This commit is contained in:
parent
4d40636748
commit
1168a29ecd
1 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ int main(int argc, char **argv)
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
inFile = argv[1];
|
||||
fin = fopen(inFile, "r");
|
||||
fin = fopen(inFile, "rb");
|
||||
if (fin==NULL)
|
||||
{
|
||||
fprintf(stderr, "failed to open input file: %s\n", strerror(errno));
|
||||
|
@ -101,7 +101,7 @@ int main(int argc, char **argv)
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
outFile = argv[2];
|
||||
fout = fopen(outFile, "w");
|
||||
fout = fopen(outFile, "wb");
|
||||
if (fout==NULL)
|
||||
{
|
||||
fprintf(stderr, "failed to open output file: %s\n", strerror(errno));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue