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
884742bd
Commit
884742bd
authored
Dec 16, 2002
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a possible crash.
parent
aa4f7ea9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
40 deletions
+11
-40
modules/gui/beos/AudioOutput.cpp
modules/gui/beos/AudioOutput.cpp
+11
-40
No files found.
modules/gui/beos/AudioOutput.cpp
View file @
884742bd
...
...
@@ -2,7 +2,7 @@
* AudioOutput.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: AudioOutput.cpp,v 1.2
0 2002/12/09 13:37:38
titer Exp $
* $Id: AudioOutput.cpp,v 1.2
1 2002/12/16 20:18:42
titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
...
...
@@ -38,9 +38,6 @@
#include <vlc/aout.h>
#include <aout_internal.h>
#define FRAME_SIZE 2048
#define BUFFER_SIZE 16384
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
*****************************************************************************/
...
...
@@ -63,7 +60,6 @@ static void DoNothing ( aout_instance_t *p_aout );
*****************************************************************************/
int
E_
(
OpenAudio
)
(
vlc_object_t
*
p_this
)
{
int
i_nb_channels
;
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
p_this
;
p_aout
->
output
.
p_sys
=
(
aout_sys_t
*
)
malloc
(
sizeof
(
aout_sys_t
)
);
if
(
p_aout
->
output
.
p_sys
==
NULL
)
...
...
@@ -71,41 +67,21 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
msg_Err
(
p_aout
,
"Not enough memory"
);
return
-
1
;
}
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
aout_VolumeSoftInit
(
p_aout
);
media_raw_audio_format
*
p_format
;
p_format
=
(
media_raw_audio_format
*
)
malloc
(
sizeof
(
media_raw_audio_format
)
);
p_format
->
frame_rate
=
p_aout
->
output
.
output
.
i_rate
;
i_nb_channels
=
aout_FormatNbChannels
(
&
p_aout
->
output
.
output
);
if
(
i_nb_channels
>
2
)
{
/* BSoundPlayer does not support more than 2 channels AFAIK */
i_nb_channels
=
2
;
p_aout
->
output
.
output
.
i_physical_channels
=
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
;
}
p_format
->
channel_count
=
i_nb_channels
;
p_format
->
format
=
media_raw_audio_format
::
B_AUDIO_FLOAT
;
#ifdef WORDS_BIGENDIAN
p_format
->
byte_order
=
B_MEDIA_BIG_ENDIAN
;
#else
p_format
->
byte_order
=
B_MEDIA_LITTLE_ENDIAN
;
#endif
p_aout
->
output
.
output
.
i_format
=
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
);
p_format
->
buffer_size
=
BUFFER_SIZE
;
p_aout
->
output
.
i_nb_samples
=
FRAME_SIZE
;
/* BSoundPlayer likes 44khz stereo */
p_aout
->
output
.
output
.
i_rate
=
44100
;
p_aout
->
output
.
output
.
i_physical_channels
=
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
;
/* BSoundPlayer wants 8192 bytes buffers.
8192 = i_nb_samples * 2 (stereo) * 4 (fl32) */
p_aout
->
output
.
i_nb_samples
=
1024
;
p_aout
->
output
.
pf_play
=
DoNothing
;
p_sys
->
p_player
=
new
BSoundPlayer
(
p_format
,
"player"
,
Play
,
NULL
,
p_aout
);
p_sys
->
p_player
=
new
BSoundPlayer
(
"player"
,
Play
,
NULL
,
p_aout
);
if
(
p_sys
->
p_player
->
InitCheck
()
!=
B_OK
)
{
msg_Err
(
p_aout
,
"BSoundPlayer InitCheck failed"
);
...
...
@@ -150,17 +126,12 @@ static void Play( void *aout, void *p_buffer, size_t i_size,
{
memcpy
(
(
float
*
)
p_buffer
,
p_aout_buffer
->
p_buffer
,
MIN
(
BUFFER_SIZE
,
p_aout_buffer
->
i_nb_bytes
)
);
if
(
p_aout_buffer
->
i_nb_bytes
<
BUFFER_SIZE
)
{
memset
(
(
float
*
)
p_buffer
+
p_aout_buffer
->
i_nb_bytes
,
0
,
BUFFER_SIZE
-
p_aout_buffer
->
i_nb_bytes
);
}
p_aout_buffer
->
i_nb_bytes
);
aout_BufferFree
(
p_aout_buffer
);
}
else
{
memset
(
(
float
*
)
p_buffer
,
0
,
BUFFER_SIZE
);
memset
(
(
float
*
)
p_buffer
,
0
,
i_size
);
}
}
...
...
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