linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] endian bug in msfileplayer?


From: Benjamin Glass
Subject: [Linphone-developers] endian bug in msfileplayer?
Date: Thu, 27 Jul 2006 09:25:09 +0200
User-agent: Thunderbird 1.5.0.4 (X11/20060615)

Hi,

I just set up a ringer device for linphone 1.3.99-7 , and realized that the ringback.wav/oldphone.wav are played back distorted. I'm running linphone on a bigendian architecture, so I used sox to convert
the wav files to big endian format, and that fixes the problem.
I looked a bit at the code, and I have WORDS_BIGENDIAN defined. In msfileplayer.c , there's :

static void read_wav_header(PlayerData *d){
   char header[sizeof(wave_header_t)];
   wave_header_t *wav=(wave_header_t*)header;
   if (read(d->fd,header,sizeof(header))!=sizeof(header)){
       ms_warning("Could not read wav header");
       return;
   }
   d->rate=wave_header_get_rate(wav);
   d->nchannels=wave_header_get_channel(wav);
   d->hsize=sizeof(header);
#ifdef WORDS_BIGENDIAN
   d->swap=TRUE;
#endif
}

The "swap" flag is set here, and I grepped through the code for it, but it seems to be never used?

In the waveheader.h , I checked the big/littlendian conversion macros, they seem to be ok, but shouldn't be "le_uint16/32()" used somewhere to read the audio samples in the correct byte order from the file?

regards,
Benjamin






reply via email to

[Prev in Thread] Current Thread [Next in Thread]