Re: Ogle crashes when returning to menu

H}kan Hjort <[email protected]>
Newsgroups gmane.comp.video.ogle.user
Message-ID <[email protected]>
Sat Dec 20 2003, Arno Töll wrote:
> Am Fr, 2003-12-19 um 11.00 schrieb H}kan Hjort:
> 
> > Damn thats strange, debug info should be included by default.  It should
> > only be removed if you do a 'make install-strip' instead of a normal
> > 'make install'.
> 
> You're right. I compiled ogle by myself, but I use checkinstall to keep
> the overview. However this tool seems to strip debug informations. Well
> I made 'make install' manually, so I have now the needed informations:
> 
-snip-
> 0x0804ecd0 in decode_lpcm (handle=0x8077d68, start=0x0, len=2011, 
>     pts_offset=3, new_PTS=8951, scr_nr=0) at decode_lpcm.c:196
> 196         time_to_first_au = samples_to_first_au * PTS_BASE /
> handle->sample_rate;
> (gdb) bt
> #0  0x0804ecd0 in decode_lpcm (handle=0x8077d68, start=0x0, len=2011, 
>     pts_offset=3, new_PTS=8951, scr_nr=0) at decode_lpcm.c:196

Ah.. ok I think I found this.  We where not zeroing all the members in
one of the structures.  It looks like we where handed back the same
memmory that we just freed and so the old 'audio format' was the same
as the new.  So no init was done, and teh sample rate ended up beeing 0.
Not so good.

I've checked in a fix to CVS, and I'm attaching a patch here.
You should be able to apply it as 'patch < arno.patch' if your
current directory is 'ogle-0.9.3/ac3/'.

Let me know if this fixes the problem.

-- 
Håkan Hjort
arno.patch (text/plain, 2.9 KB)
? arno.patch
Index: decode_a52.c
===================================================================
RCS file: /cvsroot/ogle/ogle/ac3/decode_a52.c,v
retrieving revision 1.22
diff -p -u -d -r1.22 decode_a52.c
--- decode_a52.c	2003/04/13 15:42:56	1.22
+++ decode_a52.c	2003/12/21 00:24:21
@@ -491,7 +491,7 @@ adec_handle_t *init_a52(void)
     return NULL;
   }
   
-  memset(&handle->handle, 0, sizeof(struct adec_handle_s));
+  memset(&handle->handle, 0, sizeof(adec_a52_handle_t));
   // not set: drain  
   handle->handle.decode = (audio_decode_t) decode_a52;  // function pointers
   handle->handle.flush  = (audio_flush_t)  flush_a52;
Index: decode_dts.c
===================================================================
RCS file: /cvsroot/ogle/ogle/ac3/decode_dts.c,v
retrieving revision 1.4
diff -p -u -d -r1.4 decode_dts.c
--- decode_dts.c	2003/05/23 19:28:56	1.4
+++ decode_dts.c	2003/12/21 00:24:21
@@ -442,7 +442,7 @@ adec_handle_t *init_dts(void)
     return NULL;
   }
   
-  memset(&handle->handle, 0, sizeof(struct adec_handle_s));
+  memset(&handle->handle, 0, sizeof(adec_dts_handle_t));
   // not set: drain  
   handle->handle.decode = (audio_decode_t) decode_dts;  // function pointers
   handle->handle.flush  = (audio_flush_t)  flush_dts;
Index: decode_lpcm.c
===================================================================
RCS file: /cvsroot/ogle/ogle/ac3/decode_lpcm.c,v
retrieving revision 1.11
diff -p -u -d -r1.11 decode_lpcm.c
--- decode_lpcm.c	2003/09/22 07:08:14	1.11
+++ decode_lpcm.c	2003/12/21 00:24:21
@@ -266,7 +266,7 @@ adec_handle_t *init_lpcm(void)
     return NULL;
   }
   
-  memset(&handle->handle, 0, sizeof(struct adec_handle_s));
+  memset(&handle->handle, 0, sizeof(adec_lpcm_handle_t));
   // not set: drain
   handle->handle.decode = (audio_decode_t) decode_lpcm;  // function pointers
   handle->handle.flush  = (audio_flush_t)  flush_lpcm;
@@ -278,9 +278,9 @@ adec_handle_t *init_lpcm(void)
   handle->PTS = 0;
   handle->pts_valid = 0;
   handle->scr_nr = 0;
-  handle->sample_rate = 0;
-  //  handle->decoded_format = NULL;
-
+  // Should really be an invalid value to force the init code in decode_lpcm
+  // run the first time (calles audio_config & init_sample_conversion).
+  handle->lpcm_info = 0xff;
   
   return (adec_handle_t *)handle;
 }
Index: decode_mpeg.c
===================================================================
RCS file: /cvsroot/ogle/ogle/ac3/decode_mpeg.c,v
retrieving revision 1.9
diff -p -u -d -r1.9 decode_mpeg.c
--- decode_mpeg.c	2003/01/02 21:05:56	1.9
+++ decode_mpeg.c	2003/12/21 00:24:21
@@ -248,7 +248,7 @@ adec_handle_t *init_mpeg(void)
     return NULL;
   }
   
-  memset(&handle->handle, 0, sizeof(struct adec_handle_s));
+  memset(&handle->handle, 0, sizeof(adec_mpeg_handle_t));
   // not set: drain
   handle->handle.decode = (audio_decode_t) decode_mpeg;  // function pointers
   handle->handle.flush  = (audio_flush_t)  flush_mpeg;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.