Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
e83cd176
Commit
e83cd176
authored
Apr 09, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: allocate decoder audio buffers directly
Do not convert from samples to duration and back to samples.
parent
dc5827ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
src/audio_output/dec.c
src/audio_output/dec.c
+11
-15
No files found.
src/audio_output/dec.c
View file @
e83cd176
...
...
@@ -221,8 +221,8 @@ int aout_DecDelete( aout_instance_t * p_aout, aout_input_t * p_input )
aout_buffer_t
*
aout_DecNewBuffer
(
aout_input_t
*
p_input
,
size_t
i_nb_samples
)
{
aout_buffer_t
*
p_buffer
;
mtime_t
duration
;
block_t
*
block
;
size_t
length
;
aout_lock_input
(
NULL
,
p_input
);
...
...
@@ -232,25 +232,21 @@ aout_buffer_t * aout_DecNewBuffer( aout_input_t * p_input,
return
NULL
;
}
duration
=
(
1000000
*
(
mtime_t
)
i_nb_samples
)
/
p_input
->
input
.
i_rate
;
/* This necessarily allocates in the heap. */
p_buffer
=
aout_BufferAlloc
(
&
p_input
->
input_alloc
,
duration
,
NULL
);
if
(
p_buffer
!=
NULL
)
p_buffer
->
i_buffer
=
i_nb_samples
*
p_input
->
input
.
i_bytes_per_frame
/
p_input
->
input
.
i_frame_length
;
length
=
i_nb_samples
*
p_input
->
input
.
i_bytes_per_frame
/
p_input
->
input
.
i_frame_length
;
block
=
block_Alloc
(
length
);
/* Suppose the decoder doesn't have more than one buffered buffer */
p_input
->
b_changed
=
false
;
aout_unlock_input
(
NULL
,
p_input
);
if
(
p_buffer
==
NULL
)
return
NULL
;
p_buffer
->
i_nb_samples
=
i_nb_samples
;
p_buffer
->
i_pts
=
p_buffer
->
i_length
=
0
;
return
p_buffer
;
if
(
likely
(
block
!=
NULL
)
)
{
block
->
i_nb_samples
=
i_nb_samples
;
block
->
i_pts
=
block
->
i_length
=
0
;
}
return
block
;
}
/*****************************************************************************
...
...
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