fix size of wav file for media player

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@534 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
aymeric 2009-07-13 13:47:43 +00:00
parent 24fdc43a42
commit 3c46e09288

View file

@ -122,6 +122,9 @@ static void write_wav_header(int rate,int size, char *filename){
}
static int rec_open(MSFilter *f, void *arg){
wave_header_t header;
DWORD bytes_written=0;
RecState *s=(RecState*)f->data;
const char *filename=(const char*)arg;
ms_mutex_lock(&f->lock);
@ -141,6 +144,12 @@ static int rec_open(MSFilter *f, void *arg){
return -1;
}
memset(&header ,0,sizeof(header));
WriteFile(s->fd,&header,sizeof(header), &bytes_written, NULL);
if (bytes_written!=sizeof(header)){
ms_warning("Fail to write wav header.");
}
s->state=Stopped;
ms_mutex_unlock(&f->lock);
return 0;