Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
63757407
Commit
63757407
authored
Jan 16, 2001
by
Pierre Baillet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- minor cosmetic changes :P
- modified alsa and sdl default level to 50.
parent
4cff6916
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
14 deletions
+33
-14
plugins/alsa/aout_alsa.c
plugins/alsa/aout_alsa.c
+1
-1
plugins/sdl/aout_sdl.c
plugins/sdl/aout_sdl.c
+32
-13
No files found.
plugins/alsa/aout_alsa.c
View file @
63757407
...
@@ -145,7 +145,7 @@ static int aout_Probe( probedata_t *p_data )
...
@@ -145,7 +145,7 @@ static int aout_Probe( probedata_t *p_data )
}
}
/* And return score */
/* And return score */
return
(
10
0
);
return
(
5
0
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
plugins/sdl/aout_sdl.c
View file @
63757407
...
@@ -66,6 +66,7 @@ typedef struct aout_sys_s
...
@@ -66,6 +66,7 @@ typedef struct aout_sys_s
{
{
byte_t
*
audio_buf
;
byte_t
*
audio_buf
;
int
i_audio_end
;
int
i_audio_end
;
boolean_t
b_active
;
}
aout_sys_t
;
}
aout_sys_t
;
...
@@ -107,7 +108,10 @@ static int aout_Probe( probedata_t *p_data )
...
@@ -107,7 +108,10 @@ static int aout_Probe( probedata_t *p_data )
/* Start AudioSDL */
/* Start AudioSDL */
if
(
SDL_Init
(
SDL_INIT_AUDIO
)
!=
0
)
if
(
SDL_Init
(
SDL_INIT_AUDIO
)
!=
0
)
intf_ErrMsgImm
(
"aout_Probe: SDL init error: %s"
,
SDL_GetError
()
);
{
intf_DbgMsg
(
"aout_Probe: SDL init error: %s"
,
SDL_GetError
()
);
return
(
0
);
}
/* asks for a minimum audio spec so that we are sure the dsp exists */
/* asks for a minimum audio spec so that we are sure the dsp exists */
desired
=
(
SDL_AudioSpec
*
)
malloc
(
sizeof
(
SDL_AudioSpec
)
);
desired
=
(
SDL_AudioSpec
*
)
malloc
(
sizeof
(
SDL_AudioSpec
)
);
...
@@ -125,14 +129,17 @@ static int aout_Probe( probedata_t *p_data )
...
@@ -125,14 +129,17 @@ static int aout_Probe( probedata_t *p_data )
* the plugin. Return a score of 0. */
* the plugin. Return a score of 0. */
if
(
SDL_OpenAudio
(
desired
,
obtained
)
<
0
)
if
(
SDL_OpenAudio
(
desired
,
obtained
)
<
0
)
{
{
SDL_CloseAudio
();
free
(
desired
);
intf_ErrMsgImm
(
"aout_Probe: aout sdl error : %s"
,
SDL_GetError
()
);
free
(
obtained
);
intf_DbgMsg
(
"aout_Probe: aout sdl error : %s"
,
SDL_GetError
()
);
return
(
0
);
return
(
0
);
}
}
free
(
desired
);
free
(
obtained
);
/* Otherwise, there are good chances we can use this plugin, return 100. */
/* Otherwise, there are good chances we can use this plugin, return 100. */
SDL_CloseAudio
();
SDL_CloseAudio
();
return
(
10
0
);
return
(
5
0
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -144,7 +151,7 @@ static int aout_Probe( probedata_t *p_data )
...
@@ -144,7 +151,7 @@ static int aout_Probe( probedata_t *p_data )
static
int
aout_Open
(
aout_thread_t
*
p_aout
)
static
int
aout_Open
(
aout_thread_t
*
p_aout
)
{
{
SDL_AudioSpec
*
desired
;
SDL_AudioSpec
*
desired
;
int
i_
stereo
=
p_aout
->
b_stereo
?
2
:
1
;
int
i_
channels
=
p_aout
->
b_stereo
?
2
:
1
;
/* asks for a minimum audio spec so that we are sure the dsp exists */
/* asks for a minimum audio spec so that we are sure the dsp exists */
desired
=
(
SDL_AudioSpec
*
)
malloc
(
sizeof
(
SDL_AudioSpec
)
);
desired
=
(
SDL_AudioSpec
*
)
malloc
(
sizeof
(
SDL_AudioSpec
)
);
...
@@ -176,7 +183,7 @@ static int aout_Open( aout_thread_t *p_aout )
...
@@ -176,7 +183,7 @@ static int aout_Open( aout_thread_t *p_aout )
/* TODO: write conversion beetween AOUT_FORMAT_DEFAULT
/* TODO: write conversion beetween AOUT_FORMAT_DEFAULT
* AND AUDIO* from SDL. */
* AND AUDIO* from SDL. */
desired
->
format
=
AUDIO_S16LSB
;
/* stereo 16 bits */
desired
->
format
=
AUDIO_S16LSB
;
/* stereo 16 bits */
desired
->
channels
=
i_
stereo
;
desired
->
channels
=
i_
channels
;
desired
->
callback
=
SDL_aout_callback
;
desired
->
callback
=
SDL_aout_callback
;
desired
->
userdata
=
p_aout
->
p_sys
;
desired
->
userdata
=
p_aout
->
p_sys
;
desired
->
samples
=
2048
;
desired
->
samples
=
2048
;
...
@@ -188,10 +195,13 @@ static int aout_Open( aout_thread_t *p_aout )
...
@@ -188,10 +195,13 @@ static int aout_Open( aout_thread_t *p_aout )
*/
*/
if
(
SDL_OpenAudio
(
desired
,
NULL
)
<
0
)
if
(
SDL_OpenAudio
(
desired
,
NULL
)
<
0
)
{
{
intf_ErrMsgImm
(
"aout_Open error: can't open audio device: %s"
,
free
(
desired
);
intf_ErrMsg
(
"aout_Open error: can't open audio device: %s"
,
SDL_GetError
()
);
SDL_GetError
()
);
return
(
-
1
);
return
(
-
1
);
}
}
p_aout
->
p_sys
->
b_active
=
1
;
free
(
desired
);
SDL_PauseAudio
(
0
);
SDL_PauseAudio
(
0
);
return
(
0
);
return
(
0
);
...
@@ -225,7 +235,13 @@ static int aout_SetFormat( aout_thread_t *p_aout )
...
@@ -225,7 +235,13 @@ static int aout_SetFormat( aout_thread_t *p_aout )
SDL_PauseAudio
(
1
);
SDL_PauseAudio
(
1
);
SDL_CloseAudio
();
SDL_CloseAudio
();
if
(
SDL_OpenAudio
(
desired
,
NULL
)
<
0
)
if
(
SDL_OpenAudio
(
desired
,
NULL
)
<
0
)
{
free
(
desired
);
p_aout
->
p_sys
->
b_active
=
0
;
return
(
-
1
);
return
(
-
1
);
}
p_aout
->
p_sys
->
b_active
=
1
;
free
(
desired
);
SDL_PauseAudio
(
0
);
SDL_PauseAudio
(
0
);
return
(
0
);
return
(
0
);
}
}
...
@@ -249,7 +265,7 @@ static void SDL_aout_callback(void *userdata, byte_t *stream, int len)
...
@@ -249,7 +265,7 @@ static void SDL_aout_callback(void *userdata, byte_t *stream, int len)
if
(
end
>
OVERFLOWLIMIT
)
if
(
end
>
OVERFLOWLIMIT
)
{
{
intf_ErrMsg
Imm
(
"aout SDL_aout_callback: Overflow."
);
intf_ErrMsg
(
"aout SDL_aout_callback: Overflow."
);
free
(
p_sys
->
audio_buf
);
free
(
p_sys
->
audio_buf
);
p_sys
->
audio_buf
=
NULL
;
p_sys
->
audio_buf
=
NULL
;
p_sys
->
i_audio_end
=
0
;
p_sys
->
i_audio_end
=
0
;
...
@@ -292,12 +308,15 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
...
@@ -292,12 +308,15 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
*****************************************************************************/
*****************************************************************************/
static
void
aout_Close
(
aout_thread_t
*
p_aout
)
static
void
aout_Close
(
aout_thread_t
*
p_aout
)
{
{
SDL_LockAudio
();
/* Stop callbacking */
if
(
p_aout
->
p_sys
->
b_active
)
SDL_PauseAudio
(
1
);
/* pause audio */
if
(
p_aout
->
p_sys
->
audio_buf
!=
NULL
)
/* do we have a buffer now ? */
{
{
free
(
p_aout
->
p_sys
->
audio_buf
);
SDL_PauseAudio
(
1
);
/* pause audio */
if
(
p_aout
->
p_sys
->
audio_buf
!=
NULL
)
/* do we have a buffer now ? */
{
free
(
p_aout
->
p_sys
->
audio_buf
);
}
p_aout
->
p_sys
->
b_active
=
0
;
/* just for sam */
}
}
free
(
p_aout
->
p_sys
);
/* Close the Output. */
free
(
p_aout
->
p_sys
);
/* Close the Output. */
SDL_CloseAudio
();
SDL_CloseAudio
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment