From eb3614aa7292391c9edba22cd775d69d81a401a8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 17 May 2004 17:31:48 +0000 Subject: [PATCH] ext/shout2/gstshout2.c: Guimond, fixes #142432) Original commit message from CVS: * ext/shout2/gstshout2.c: use application/ogg instead of application/x-ogg (patch by Patrick Guimond, fixes #142432) * sys/oss/gstosselement.c: (gst_osselement_reset), (gst_osselement_sync_parms): don't set fragment size unless specified --- ChangeLog | 9 +++++++++ ext/shout2/gstshout2.c | 2 +- sys/oss/gstosselement.c | 22 +++++++++++++++++----- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54fff9e..5e4fac2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-05-17 Benjamin Otte + + * ext/shout2/gstshout2.c: + use application/ogg instead of application/x-ogg (patch by Patrick + Guimond, fixes #142432) + * sys/oss/gstosselement.c: (gst_osselement_reset), + (gst_osselement_sync_parms): + don't set fragment size unless specified + 2004-05-17 Stephane Loeuillet * configure.ac : fix compilation of v4l2src with "-Wall -Werror" diff --git a/ext/shout2/gstshout2.c b/ext/shout2/gstshout2.c index 1383df1..423131b 100644 --- a/ext/shout2/gstshout2.c +++ b/ext/shout2/gstshout2.c @@ -61,7 +61,7 @@ enum static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("application/x-ogg; " + GST_STATIC_CAPS ("application/ogg; " "audio/mpeg, mpegversion = (int) 1, layer = (int) [ 1, 3 ]") ); diff --git a/sys/oss/gstosselement.c b/sys/oss/gstosselement.c index a990c22..2ce321b 100644 --- a/sys/oss/gstosselement.c +++ b/sys/oss/gstosselement.c @@ -440,7 +440,7 @@ gst_osselement_reset (GstOssElement * oss) oss->depth = 16; oss->channels = 2; oss->rate = 44100; - oss->fragment = 6; + oss->fragment = 0; oss->bps = 0; /* AFMT_*_BE not available on all OSS includes (e.g. FBSD) */ @@ -585,21 +585,29 @@ gst_osselement_sync_parms (GstOssElement * oss) gint target_format; gint target_channels; gint target_rate; - gint fragscale, frag_ln; + + /* gint fragscale, frag_ln; */ if (oss->fd == -1) return FALSE; - if (oss->fragment >> 16) + if ((oss->fragment & 0xFFFF) == 0) { + frag = 0; + } else if (oss->fragment >> 16) { frag = oss->fragment; - else + } else { frag = 0x7FFF0000 | oss->fragment; + } GST_INFO ("osselement: setting sound card to %dHz %d format %s (%08x fragment)", oss->rate, oss->format, (oss->channels == 2) ? "stereo" : "mono", frag); + g_print + ("osselement: setting sound card to %dHz %d format %s (%08x fragment)\n", + oss->rate, oss->format, (oss->channels == 2) ? "stereo" : "mono", frag); - ioctl (oss->fd, SNDCTL_DSP_SETFRAGMENT, &frag); + if (frag) + ioctl (oss->fd, SNDCTL_DSP_SETFRAGMENT, &frag); ioctl (oss->fd, SNDCTL_DSP_RESET, 0); target_format = oss->format; @@ -618,6 +626,9 @@ gst_osselement_sync_parms (GstOssElement * oss) ioctl (oss->fd, SNDCTL_DSP_GETISPACE, &space); } +#if 0 + /* FIXME: make the current fragment info available somehow + * the current way overrides preset values and that sucks */ /* calculate new fragment using a poor man's logarithm function */ fragscale = 1; frag_ln = 0; @@ -626,6 +637,7 @@ gst_osselement_sync_parms (GstOssElement * oss) frag_ln++; } oss->fragment = space.fragstotal << 16 | frag_ln; +#endif GST_INFO ("osselement: set sound card to %dHz, %d format, %s " "(%d bytes buffer, %08x fragment)", -- 2.7.4