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
2e12c3f3
Commit
2e12c3f3
authored
Jan 30, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ugly resampler: no need to allocate a buffer when down-sampling
parent
e8beaf5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
modules/audio_filter/resampler/ugly.c
modules/audio_filter/resampler/ugly.c
+9
-4
No files found.
modules/audio_filter/resampler/ugly.c
View file @
2e12c3f3
...
@@ -90,9 +90,12 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
...
@@ -90,9 +90,12 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
/
p_filter
->
fmt_in
.
audio
.
i_rate
;
/
p_filter
->
fmt_in
.
audio
.
i_rate
;
unsigned
int
i_sample_bytes
=
i_nb_channels
*
sizeof
(
int32_t
);
unsigned
int
i_sample_bytes
=
i_nb_channels
*
sizeof
(
int32_t
);
block_t
*
p_out_buf
=
block_Alloc
(
i_out_nb
*
i_sample_bytes
);
if
(
p_filter
->
fmt_out
.
audio
.
i_rate
>
p_filter
->
fmt_in
.
audio
.
i_rate
)
if
(
!
p_out_buf
)
{
goto
out
;
p_out_buf
=
block_Alloc
(
i_out_nb
*
i_sample_bytes
);
if
(
!
p_out_buf
)
goto
out
;
}
int32_t
*
p_out
=
(
int32_t
*
)
p_out_buf
->
p_buffer
;
int32_t
*
p_out
=
(
int32_t
*
)
p_out_buf
->
p_buffer
;
const
int32_t
*
p_in
=
(
int32_t
*
)
p_in_buf
->
p_buffer
;
const
int32_t
*
p_in
=
(
int32_t
*
)
p_in_buf
->
p_buffer
;
...
@@ -120,7 +123,9 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
...
@@ -120,7 +123,9 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
p_out_buf
->
i_pts
=
p_in_buf
->
i_pts
;
p_out_buf
->
i_pts
=
p_in_buf
->
i_pts
;
p_out_buf
->
i_length
=
p_out_buf
->
i_nb_samples
*
p_out_buf
->
i_length
=
p_out_buf
->
i_nb_samples
*
1000000
/
p_filter
->
fmt_out
.
audio
.
i_rate
;
1000000
/
p_filter
->
fmt_out
.
audio
.
i_rate
;
if
(
p_in_buf
!=
p_out_buf
)
out:
out:
block_Release
(
p_in_buf
);
block_Release
(
p_in_buf
);
return
p_out_buf
;
return
p_out_buf
;
}
}
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