GNOME Bugzilla – Bug 326601
GstRingBuffer crashes with alaw/mulaw caps
Last modified: 2006-01-11 15:14:01 UTC
Please describe the problem: It is not possible to create a source element (based on audiosink) that has following caps: "audio/x-alaw, " "rate = (int)8000, " "channels = (int) 1" "audio/x-ulaw, " "rate = (int)8000, " "channels = (int) 1" If such element is tried to be made, gstringbuffer.c throws floating point exception because there is division by zero situation. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Problem can be fixed with following patch: Index: gstringbuffer.c =================================================================== --- gstringbuffer.c.orig 2005-12-09 12:47:30.000000000 +0200 +++ gstringbuffer.c 2005-12-12 17:27:19.000000000 +0200 @@ -302,9 +302,13 @@ } else if (!strncmp (mimetype, "audio/x-alaw", 12)) { spec->type = GST_BUFTYPE_A_LAW; spec->format = GST_A_LAW; + spec->width = 8; + spec->depth = 8; } else if (!strncmp (mimetype, "audio/x-mulaw", 13)) { spec->type = GST_BUFTYPE_MU_LAW; spec->format = GST_MU_LAW; + spec->width = 8; + spec->depth = 8; } else { goto parse_error; }
Fixed in CVS, thanks for the patch! 2006-01-11 Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com> * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_parse_caps): Set depth and width for alaw/mulaw (fixes #326601).