1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00

*It seems that the setting of the fragment size was buggy.

OSS work with my sblive! now :). It still works on my other computer too
but please test.
This commit is contained in:
Stéphane Borel 2002-08-31 22:10:25 +00:00
parent 4d51273f15
commit 13f459366e

View File

@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc * oss.c : OSS /dev/dsp module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2002 VideoLAN * Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.21 2002/08/30 23:27:06 massiot Exp $ * $Id: oss.c,v 1.22 2002/08/31 22:10:25 stef Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
@ -102,6 +102,7 @@ static int Open( vlc_object_t *p_this )
char * psz_device; char * psz_device;
int i_format; int i_format;
int i_rate; int i_rate;
int i_frame_size;
int i_fragments; int i_fragments;
vlc_bool_t b_stereo; vlc_bool_t b_stereo;
@ -140,8 +141,16 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* Set the fragment size */ /* Set the fragment size
i_fragments = FRAME_COUNT << 16 | FRAME_SIZE; * i_fragment = xxxxyyyy where: xxxx is fragtotal
* 1 << yyyy is fragsize */
i_fragments = 0;
i_frame_size = FRAME_SIZE;
while( i_frame_size >>= 1 )
{
++i_fragments;
}
i_fragments |= FRAME_COUNT << 16;
if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFRAGMENT, &i_fragments ) < 0 ) if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFRAGMENT, &i_fragments ) < 0 )
{ {
msg_Err( p_aout, "cannot set fragment size (%.8x)", i_fragments ); msg_Err( p_aout, "cannot set fragment size (%.8x)", i_fragments );
@ -257,7 +266,7 @@ static void Close( vlc_object_t * p_this )
/***************************************************************************** /*****************************************************************************
* BufferDuration: buffer status query * BufferDuration: buffer status query
***************************************************************************** *****************************************************************************
* This function returns the duration in microseconfs of the current buffer. * This function returns the duration in microseconds of the current buffer.
*****************************************************************************/ *****************************************************************************/
static mtime_t BufferDuration( aout_instance_t * p_aout ) static mtime_t BufferDuration( aout_instance_t * p_aout )
{ {