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
c22195b4
Commit
c22195b4
authored
Sep 03, 2009
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout_BufferAlloc : returns the allocated buffer
parent
0a983612
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
24 deletions
+19
-24
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+2
-2
src/audio_output/common.c
src/audio_output/common.c
+5
-9
src/audio_output/dec.c
src/audio_output/dec.c
+2
-2
src/audio_output/filters.c
src/audio_output/filters.c
+4
-4
src/audio_output/mixer.c
src/audio_output/mixer.c
+6
-7
No files found.
src/audio_output/aout_internal.h
View file @
c22195b4
...
...
@@ -28,8 +28,8 @@
#ifndef __LIBVLC_AOUT_INTERNAL_H
# define __LIBVLC_AOUT_INTERNAL_H 1
void
aout_BufferAlloc
(
aout_alloc_t
*
allocation
,
mtime_t
microseconds
,
aout_buffer_t
*
old_buffer
,
aout_buffer_t
**
new_buffer
);
aout_buffer_t
*
aout_BufferAlloc
(
aout_alloc_t
*
allocation
,
mtime_t
microseconds
,
aout_buffer_t
*
old_buffer
);
struct
aout_filter_owner_sys_t
{
...
...
src/audio_output/common.c
View file @
c22195b4
...
...
@@ -701,13 +701,12 @@ bool aout_CheckChannelExtraction( int *pi_selection,
* aout_BufferAlloc:
*****************************************************************************/
void
aout_BufferAlloc
(
aout_alloc_t
*
allocation
,
mtime_t
microseconds
,
aout_buffer_t
*
old_buffer
,
aout_buffer_t
**
new_buffer
)
aout_buffer_t
*
aout_BufferAlloc
(
aout_alloc_t
*
allocation
,
mtime_t
microseconds
,
aout_buffer_t
*
old_buffer
)
{
if
(
!
allocation
->
b_alloc
)
{
*
new_buffer
=
old_buffer
;
return
;
return
old_buffer
;
}
aout_buffer_t
*
buffer
;
...
...
@@ -718,10 +717,7 @@ void aout_BufferAlloc(aout_alloc_t *allocation, mtime_t microseconds,
buffer
=
malloc
(
i_alloc_size
+
sizeof
(
aout_buffer_t
)
);
if
(
!
buffer
)
{
*
new_buffer
=
NULL
;
return
;
}
return
NULL
;
buffer
->
b_alloc
=
true
;
buffer
->
i_size
=
i_alloc_size
;
...
...
@@ -734,5 +730,5 @@ void aout_BufferAlloc(aout_alloc_t *allocation, mtime_t microseconds,
buffer
->
end_date
=
old_buffer
->
end_date
;
}
*
new_buffer
=
buffer
;
return
buffer
;
}
src/audio_output/dec.c
View file @
c22195b4
...
...
@@ -267,7 +267,7 @@ aout_buffer_t * aout_DecNewBuffer( aout_input_t * p_input,
duration
=
(
1000000
*
(
mtime_t
)
i_nb_samples
)
/
p_input
->
input
.
i_rate
;
/* This necessarily allocates in the heap. */
aout_BufferAlloc
(
&
p_input
->
input_alloc
,
duration
,
NULL
,
&
p_buffer
);
p_buffer
=
aout_BufferAlloc
(
&
p_input
->
input_alloc
,
duration
,
NULL
);
if
(
p_buffer
!=
NULL
)
p_buffer
->
i_nb_bytes
=
i_nb_samples
*
p_input
->
input
.
i_bytes_per_frame
/
p_input
->
input
.
i_frame_length
;
...
...
@@ -326,7 +326,7 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
mtime_t
duration
=
(
1000000
*
(
mtime_t
)
p_buffer
->
i_nb_samples
)
/
p_input
->
input
.
i_rate
;
aout_BufferAlloc
(
&
p_input
->
input_alloc
,
duration
,
NULL
,
&
p_new_buffer
);
p_new_buffer
=
aout_BufferAlloc
(
&
p_input
->
input_alloc
,
duration
,
NULL
);
vlc_memcpy
(
p_new_buffer
->
p_buffer
,
p_buffer
->
p_buffer
,
p_buffer
->
i_nb_bytes
);
p_new_buffer
->
i_nb_samples
=
p_buffer
->
i_nb_samples
;
...
...
src/audio_output/filters.c
View file @
c22195b4
...
...
@@ -347,10 +347,10 @@ void aout_FiltersPlay( aout_instance_t * p_aout,
/* Resamplers can produce slightly more samples than (i_in_nb *
* p_filter->output.i_rate / p_filter->input.i_rate) so we need
* slightly bigger buffers. */
aout_BufferAlloc
(
&
p_filter
->
output_alloc
,
p_output_buffer
=
aout_BufferAlloc
(
&
p_filter
->
output_alloc
,
((
mtime_t
)(
*
pp_input_buffer
)
->
i_nb_samples
+
2
)
*
1000000
/
p_filter
->
input
.
i_rate
,
*
pp_input_buffer
,
&
p_out
put_buffer
);
*
pp_in
put_buffer
);
if
(
p_output_buffer
==
NULL
)
return
;
...
...
src/audio_output/mixer.c
View file @
c22195b4
...
...
@@ -333,13 +333,12 @@ static int MixBuffer( aout_instance_t * p_aout )
}
/* Run the mixer. */
aout_BufferAlloc
(
&
p_aout
->
p_mixer
->
allocation
,
p_output_buffer
=
aout_BufferAlloc
(
&
p_aout
->
p_mixer
->
allocation
,
((
uint64_t
)
p_aout
->
output
.
i_nb_samples
*
1000000
)
/
p_aout
->
output
.
output
.
i_rate
,
/* This is a bit kludgy, but is actually only used
* for the S/PDIF dummy mixer : */
p_aout
->
pp_inputs
[
i_first_input
]
->
mixer
.
fifo
.
p_first
,
&
p_output_buffer
);
p_aout
->
pp_inputs
[
i_first_input
]
->
mixer
.
fifo
.
p_first
);
if
(
p_output_buffer
==
NULL
)
{
aout_unlock_input_fifos
(
p_aout
);
...
...
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