Bug#522768: Endian issue

Gerrit Pape pape at dbnbgs.smarden.org
Mon Apr 6 11:17:02 UTC 2009


Package: linphone-nox
Version: 3.0.0-3
Tags: patch upstream

Hi, linphonec doesn't play the incoming ring sound on powerpc.  It's a
bad seek() due to an endian issue, please see the patch below.  With the
patch the ring play fine.  I'm not sure about data_chunk->len, and
didn't really check since it works for me for now.

Regards, Gerrit.


diff -urN ../linphone-3.0.0~/mediastreamer2/src/msfileplayer.c ./mediastreamer2/src/msfileplayer.c
--- ../linphone-3.0.0~/mediastreamer2/src/msfileplayer.c	2008-09-10 20:51:43.000000000 +0000
+++ ./mediastreamer2/src/msfileplayer.c	2009-04-01 08:16:13.000000000 +0000
@@ -89,12 +89,12 @@
   d->rate=le_uint32(format_chunk->rate);
   d->nchannels=le_uint16(format_chunk->channel);
   
-  if (format_chunk->len-0x10>0)
+  if (le_uint32(format_chunk->len)-0x10>0)
     {
-      lseek(d->fd,(format_chunk->len-0x10),SEEK_CUR);
+      lseek(d->fd,(le_uint32(format_chunk->len)-0x10),SEEK_CUR);
     }
   
-  d->hsize=sizeof(wave_header_t)-0x10+format_chunk->len;
+  d->hsize=sizeof(wave_header_t)-0x10+le_uint32(format_chunk->len);
   
   len = read(d->fd, header3, sizeof(header3)) ;
   if (len != sizeof(header3)){





More information about the Pkg-voip-maintainers mailing list