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
5e9d8674
Commit
5e9d8674
authored
Oct 13, 2002
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now BeOS sound is (almost) clean.
It is kludgy, but it works ;)
parent
af3a25f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
33 deletions
+25
-33
modules/gui/beos/AudioOutput.cpp
modules/gui/beos/AudioOutput.cpp
+25
-33
No files found.
modules/gui/beos/AudioOutput.cpp
View file @
5e9d8674
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* aout.cpp: BeOS audio output
* aout.cpp: BeOS audio output
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: AudioOutput.cpp,v 1.1
0 2002/10/12 12:24:52
titer Exp $
* $Id: AudioOutput.cpp,v 1.1
1 2002/10/13 15:39:16
titer Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
#include <vlc/aout.h>
#include <vlc/aout.h>
#include "aout_internal.h"
#include "aout_internal.h"
#define FRAME_SIZE 2048
/*****************************************************************************
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
* aout_sys_t: BeOS audio output method descriptor
*****************************************************************************/
*****************************************************************************/
...
@@ -45,11 +47,9 @@ typedef struct aout_sys_t
...
@@ -45,11 +47,9 @@ typedef struct aout_sys_t
{
{
BSoundPlayer
*
p_player
;
BSoundPlayer
*
p_player
;
float
*
p_buffer
;
float
*
p_buffer
;
size_t
i_buffer_size
;
int
i_got_data
;
}
aout_sys_t
;
}
aout_sys_t
;
#define FRAME_SIZE 2048
/*****************************************************************************
/*****************************************************************************
* Local prototypes.
* Local prototypes.
*****************************************************************************/
*****************************************************************************/
...
@@ -66,8 +66,8 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
...
@@ -66,8 +66,8 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
p_aout
->
output
.
p_sys
=
(
aout_sys_t
*
)
malloc
(
sizeof
(
aout_sys_t
)
);
p_aout
->
output
.
p_sys
=
(
aout_sys_t
*
)
malloc
(
sizeof
(
aout_sys_t
)
);
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
p_sys
->
i_buffer_size
=
0
;
p_sys
->
i_got_data
=
0
;
p_sys
->
p_buffer
=
NULL
;
p_sys
->
p_buffer
=
(
float
*
)
malloc
(
16384
);
/*FIXME*/
aout_VolumeSoftInit
(
p_aout
);
aout_VolumeSoftInit
(
p_aout
);
...
@@ -109,41 +109,33 @@ static void Play( void *aout, void *buffer, size_t size,
...
@@ -109,41 +109,33 @@ static void Play( void *aout, void *buffer, size_t size,
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
float
*
p_buffer
=
(
float
*
)
buffer
;
float
*
p_buffer
=
(
float
*
)
buffer
;
if
(
format
.
format
!=
media_raw_audio_format
::
B_AUDIO_FLOAT
)
/* <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
)
{
{
m
sg_Err
(
p_aout
,
"Bad audio format"
);
m
emcpy
(
p_buffer
,
p_sys
->
p_buffer
,
8192
);
return
;
p_sys
->
i_got_data
=
0
;
}
}
else
if
(
p_sys
->
i_buffer_size
<
size
)
{
{
p_aout_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
p_aout_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
if
(
p_aout_buffer
!=
NULL
)
if
(
p_aout_buffer
!=
NULL
)
{
{
if
(
p_sys
->
p_buffer
==
NULL
)
memcpy
(
p_buffer
,
{
p_aout_buffer
->
p_buffer
,
p_sys
->
p_buffer
=
(
float
*
)
malloc
(
p_aout_buffer
->
i_nb_bytes
);
8192
);
p_sys
->
i_buffer_size
=
p_aout_buffer
->
i_nb_bytes
;
memcpy
(
p_sys
->
p_buffer
,
}
p_aout_buffer
->
p_buffer
+
8192
,
else
8192
);
{
p_sys
->
i_got_data
=
1
;
realloc
(
p_sys
->
p_buffer
,
p_sys
->
i_buffer_size
+
p_aout_buffer
->
i_nb_bytes
);
memcpy
(
p_sys
->
p_buffer
+
p_sys
->
i_buffer_size
,
p_aout_buffer
->
p_buffer
,
p_aout_buffer
->
i_nb_bytes
);
p_sys
->
i_buffer_size
+=
p_aout_buffer
->
i_nb_bytes
;
}
}
}
}
}
if
(
p_sys
->
i_buffer_size
>=
size
)
/* </kludge> */
{
memcpy
(
p_buffer
,
p_sys
->
p_buffer
,
MIN
(
size
,
p_sys
->
i_buffer_size
)
);
p_sys
->
i_buffer_size
-=
MIN
(
size
,
p_sys
->
i_buffer_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