Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
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 )
}
/* 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
{
byte_t
*
audio_buf
;
int
i_audio_end
;
boolean_t
b_active
;
}
aout_sys_t
;
...
...
@@ -107,7 +108,10 @@ static int aout_Probe( probedata_t *p_data )
/* Start AudioSDL */
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 */
desired
=
(
SDL_AudioSpec
*
)
malloc
(
sizeof
(
SDL_AudioSpec
)
);
...
...
@@ -125,14 +129,17 @@ static int aout_Probe( probedata_t *p_data )
* the plugin. Return a score of 0. */
if
(
SDL_OpenAudio
(
desired
,
obtained
)
<
0
)
{
SDL_CloseAudio
();
intf_ErrMsgImm
(
"aout_Probe: aout sdl error : %s"
,
SDL_GetError
()
);
free
(
desired
);
free
(
obtained
);
intf_DbgMsg
(
"aout_Probe: aout sdl error : %s"
,
SDL_GetError
()
);
return
(
0
);
}
free
(
desired
);
free
(
obtained
);
/* Otherwise, there are good chances we can use this plugin, return 100. */
SDL_CloseAudio
();
return
(
10
0
);
return
(
5
0
);
}
/*****************************************************************************
...
...
@@ -144,7 +151,7 @@ static int aout_Probe( probedata_t *p_data )
static
int
aout_Open
(
aout_thread_t
*
p_aout
)
{
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 */
desired
=
(
SDL_AudioSpec
*
)
malloc
(
sizeof
(
SDL_AudioSpec
)
);
...
...
@@ -176,7 +183,7 @@ static int aout_Open( aout_thread_t *p_aout )
/* TODO: write conversion beetween AOUT_FORMAT_DEFAULT
* AND AUDIO* from SDL. */
desired
->
format
=
AUDIO_S16LSB
;
/* stereo 16 bits */
desired
->
channels
=
i_
stereo
;
desired
->
channels
=
i_
channels
;
desired
->
callback
=
SDL_aout_callback
;
desired
->
userdata
=
p_aout
->
p_sys
;
desired
->
samples
=
2048
;
...
...
@@ -188,10 +195,13 @@ static int aout_Open( aout_thread_t *p_aout )
*/
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
()
);
return
(
-
1
);
}
p_aout
->
p_sys
->
b_active
=
1
;
free
(
desired
);
SDL_PauseAudio
(
0
);
return
(
0
);
...
...
@@ -225,7 +235,13 @@ static int aout_SetFormat( aout_thread_t *p_aout )
SDL_PauseAudio
(
1
);
SDL_CloseAudio
();
if
(
SDL_OpenAudio
(
desired
,
NULL
)
<
0
)
{
free
(
desired
);
p_aout
->
p_sys
->
b_active
=
0
;
return
(
-
1
);
}
p_aout
->
p_sys
->
b_active
=
1
;
free
(
desired
);
SDL_PauseAudio
(
0
);
return
(
0
);
}
...
...
@@ -249,7 +265,7 @@ static void SDL_aout_callback(void *userdata, byte_t *stream, int len)
if
(
end
>
OVERFLOWLIMIT
)
{
intf_ErrMsg
Imm
(
"aout SDL_aout_callback: Overflow."
);
intf_ErrMsg
(
"aout SDL_aout_callback: Overflow."
);
free
(
p_sys
->
audio_buf
);
p_sys
->
audio_buf
=
NULL
;
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 )
*****************************************************************************/
static
void
aout_Close
(
aout_thread_t
*
p_aout
)
{
SDL_LockAudio
();
/* Stop callbacking */
SDL_PauseAudio
(
1
);
/* pause audio */
if
(
p_aout
->
p_sys
->
audio_buf
!=
NULL
)
/* do we have a buffer now ? */
if
(
p_aout
->
p_sys
->
b_active
)
{
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. */
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