[vlc-commits] access_oss: prepare for void *p_sys
Rémi Denis-Courmont
git at videolan.org
Sun Dec 3 16:57:53 CET 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 3 17:05:50 2017 +0200| [8e4802ba0bcd931bb8eff150fdc2a8158e7c785f] | committer: Rémi Denis-Courmont
access_oss: prepare for void *p_sys
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e4802ba0bcd931bb8eff150fdc2a8158e7c785f
---
modules/access/oss.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/modules/access/oss.c b/modules/access/oss.c
index 21b7cc4c08..c57068ce77 100644
--- a/modules/access/oss.c
+++ b/modules/access/oss.c
@@ -126,14 +126,16 @@ struct demux_sys_t
static int FindMainDevice( demux_t *p_demux )
{
- msg_Dbg( p_demux, "opening device '%s'", p_demux->p_sys->psz_device );
- if( ProbeAudioDevOss( p_demux, p_demux->p_sys->psz_device ) )
+ demux_sys_t *p_sys = p_demux->p_sys;
+
+ msg_Dbg( p_demux, "opening device '%s'", p_sys->psz_device );
+ if( ProbeAudioDevOss( p_demux, p_sys->psz_device ) )
{
- msg_Dbg( p_demux, "'%s' is an audio device", p_demux->p_sys->psz_device );
- p_demux->p_sys->i_fd = OpenAudioDev( p_demux );
+ msg_Dbg( p_demux, "'%s' is an audio device", p_sys->psz_device );
+ p_sys->i_fd = OpenAudioDev( p_demux );
}
- if( p_demux->p_sys->i_fd < 0 )
+ if( p_sys->i_fd < 0 )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
@@ -327,10 +329,11 @@ static block_t* GrabAudio( demux_t *p_demux )
*****************************************************************************/
static int OpenAudioDevOss( demux_t *p_demux )
{
+ demux_sys_t *p_sys = (demux_sys_t *)p_demux->p_sys;
int i_fd;
int i_format;
- i_fd = vlc_open( p_demux->p_sys->psz_device, O_RDONLY | O_NONBLOCK );
+ i_fd = vlc_open( p_sys->psz_device, O_RDONLY | O_NONBLOCK );
if( i_fd < 0 )
{
@@ -349,23 +352,21 @@ static int OpenAudioDevOss( demux_t *p_demux )
goto adev_fail;
}
- if( ioctl( i_fd, SNDCTL_DSP_STEREO,
- &p_demux->p_sys->b_stereo ) < 0 )
+ if( ioctl( i_fd, SNDCTL_DSP_STEREO, &p_sys->b_stereo ) < 0 )
{
msg_Err( p_demux, "cannot set audio channels count (%s)",
vlc_strerror_c(errno) );
goto adev_fail;
}
- if( ioctl( i_fd, SNDCTL_DSP_SPEED,
- &p_demux->p_sys->i_sample_rate ) < 0 )
+ if( ioctl( i_fd, SNDCTL_DSP_SPEED, &p_sys->i_sample_rate ) < 0 )
{
msg_Err( p_demux, "cannot set audio sample rate (%s)",
vlc_strerror_c(errno) );
goto adev_fail;
}
- p_demux->p_sys->i_max_frame_size = 6 * 1024;
+ p_sys->i_max_frame_size = 6 * 1024;
return i_fd;
More information about the vlc-commits
mailing list