ref: 505b561530ecd668339cfbe33b332f4742f5a1ea
parent: ac7490cbac7b5790a3ea2e9f7c8518af24336091
author: Gregory Maxwell <[email protected]>
date: Sun Jun 3 05:13:25 EDT 2012
Fix for windows playback non-functionality introduced by 18996cf9.
--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -296,6 +296,11 @@
exit(1);
}
fout = fdopen(audio_fd, "w");
+ if(!fout)
+ {
+ perror("Cannot open output");
+ exit(1);
+ }
#elif defined HAVE_SYS_AUDIOIO_H
audio_info_t info;
int audio_fd;
@@ -322,6 +327,11 @@
exit(1);
}
fout = fdopen(audio_fd, "w");
+ if(!fout)
+ {
+ perror("Cannot open output");
+ exit(1);
+ }
#elif defined WIN32 || defined _WIN32
{
unsigned int opus_channels = *channels;
@@ -354,11 +364,6 @@
if (strcmp(outFile+strlen(outFile)-4,".wav")==0 || strcmp(outFile+strlen(outFile)-4,".WAV")==0)
write_wav_header(fout, rate, *channels);
}
- }
- if(!fout)
- {
- perror("Cannot open output");
- exit(1);
}
return fout;
}