diff options
author | Benjamin Otte <otte@gnome.org> | 2004-05-17 17:31:48 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2004-05-17 17:31:48 +0000 |
commit | eb3614aa7292391c9edba22cd775d69d81a401a8 (patch) | |
tree | 16cfc00117bac0fb400d31c718ccccfdaaedf890 /sys/oss | |
parent | f0b81fa053f978bf45ca63135c98e32f1be72679 (diff) |
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
Diffstat (limited to 'sys/oss')
-rw-r--r-- | sys/oss/gstosselement.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/oss/gstosselement.c b/sys/oss/gstosselement.c index a990c22cb..2ce321b55 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)", |