Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
28b43ac2
Commit
28b43ac2
authored
Oct 14, 2002
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaner code.
parent
9a5df48b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
35 deletions
+22
-35
modules/gui/beos/AudioOutput.cpp
modules/gui/beos/AudioOutput.cpp
+22
-35
No files found.
modules/gui/beos/AudioOutput.cpp
View file @
28b43ac2
...
...
@@ -2,7 +2,7 @@
* aout.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: AudioOutput.cpp,v 1.1
1 2002/10/13 15:39:16
titer Exp $
* $Id: AudioOutput.cpp,v 1.1
2 2002/10/14 23:11:52
titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
...
...
@@ -32,6 +32,7 @@
#include <string.h>
#include <SoundPlayer.h>
#include <media/MediaDefs.h>
#include <vlc/vlc.h>
#include <vlc/aout.h>
...
...
@@ -46,8 +47,7 @@
typedef
struct
aout_sys_t
{
BSoundPlayer
*
p_player
;
float
*
p_buffer
;
int
i_got_data
;
}
aout_sys_t
;
/*****************************************************************************
...
...
@@ -66,18 +66,25 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
p_aout
->
output
.
p_sys
=
(
aout_sys_t
*
)
malloc
(
sizeof
(
aout_sys_t
)
);
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
p_sys
->
i_got_data
=
0
;
p_sys
->
p_buffer
=
(
float
*
)
malloc
(
16384
);
/*FIXME*/
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
;
p_format
->
channel_count
=
p_aout
->
output
.
output
.
i_channels
;
p_format
->
format
=
media_raw_audio_format
::
B_AUDIO_FLOAT
;
p_format
->
byte_order
=
B_MEDIA_LITTLE_ENDIAN
;
p_format
->
buffer_size
=
16384
;
p_aout
->
output
.
output
.
i_format
=
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
);
p_aout
->
output
.
i_nb_samples
=
FRAME_SIZE
;
p_aout
->
output
.
pf_play
=
DoNothing
;
p_aout
->
output
.
output
.
i_rate
=
44100
;
p_aout
->
output
.
output
.
i_channels
=
2
;
p_sys
->
p_player
=
new
BSoundPlayer
(
"player"
,
Play
,
NULL
,
p_this
);
p_sys
->
p_player
=
new
BSoundPlayer
(
p_format
,
"player"
,
Play
,
NULL
,
p_this
);
p_sys
->
p_player
->
Start
();
p_sys
->
p_player
->
SetHasData
(
true
);
...
...
@@ -93,7 +100,6 @@ void E_(CloseAudio) ( vlc_object_t *p_this )
aout_sys_t
*
p_sys
=
(
aout_sys_t
*
)
p_aout
->
output
.
p_sys
;
p_sys
->
p_player
->
Stop
();
p_aout
->
b_die
=
1
;
delete
p_sys
->
p_player
;
free
(
p_sys
);
}
...
...
@@ -106,36 +112,17 @@ static void Play( void *aout, void *buffer, size_t size,
{
aout_buffer_t
*
p_aout_buffer
;
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
aout
;
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
float
*
p_buffer
=
(
float
*
)
buffer
;
/* <kludge> */
/* Usually BSoundPlay asks for 8192 bytes buffers, while vlc gives
a 16384 one. So we keep the second half of it in p_sys->p_buffer */
if
(
p_sys
->
i_got_data
)
p_aout_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
if
(
p_aout_buffer
!=
NULL
)
{
memcpy
(
p_buffer
,
p_sys
->
p_buffer
,
8192
);
p_sys
->
i_got_data
=
0
;
memcpy
(
p_buffer
,
p_aout_buffer
->
p_buffer
,
MIN
(
size
,
p_aout_buffer
->
i_nb_bytes
)
);
}
else
{
p_aout_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
if
(
p_aout_buffer
!=
NULL
)
{
memcpy
(
p_buffer
,
p_aout_buffer
->
p_buffer
,
8192
);
memcpy
(
p_sys
->
p_buffer
,
p_aout_buffer
->
p_buffer
+
8192
,
8192
);
p_sys
->
i_got_data
=
1
;
}
}
/* </kludge> */
}
/*****************************************************************************
...
...
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