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
df657969
Commit
df657969
authored
Sep 18, 2002
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./modules/audio_filter/converter/s16tofloat32swab.c: compilation fix for
systems which don't have swab(). Fixed a memory leak.
parent
1522351e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
modules/audio_filter/converter/s16tofloat32swab.c
modules/audio_filter/converter/s16tofloat32swab.c
+18
-9
No files found.
modules/audio_filter/converter/s16tofloat32swab.c
View file @
df657969
...
...
@@ -3,7 +3,7 @@
* with endianness change
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: s16tofloat32swab.c,v 1.
1 2002/09/18 01:28:04 henri
Exp $
* $Id: s16tofloat32swab.c,v 1.
2 2002/09/18 12:20:37 sam
Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
...
...
@@ -31,6 +31,11 @@
#include <string.h>
#include <vlc/vlc.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "audio_output.h"
#include "aout_internal.h"
...
...
@@ -94,25 +99,29 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
#ifdef HAVE_SWAB
s16
*
p_swabbed
=
malloc
(
i
*
sizeof
(
s16
)
);
swab
(
p_in_buf
->
p_buffer
,
p_swabbed
,
i
*
sizeof
(
s16
)
);
swab
(
p_in_buf
->
p_buffer
,
p_swabbed
,
i
*
sizeof
(
s16
)
);
p_in
=
p_swabbed
+
i
-
1
;
p_in
=
p_swabbed
+
i
-
1
;
#else
byte_t
temp
;
byte_t
p_tmp
[
2
]
;
#endif
while
(
i
--
)
{
#ifndef HAVE_SWAB
temp
=
*
(
byte_t
*
)
p_in
;
*
(
byte_t
*
)
p_in
=
*
(
byte_t
*
)
p_in
+
1
;
*
(
byte_t
*
)
p_in
+
1
=
temp
;
#e
ndif
p_tmp
[
0
]
=
((
byte_t
*
)
p_in
)[
1
]
;
p_tmp
[
1
]
=
((
byte_t
*
)
p_in
)[
0
]
;
*
p_out
=
(
float
)
*
p_tmp
/
32768
.
0
;
#e
lse
*
p_out
=
(
float
)
*
p_in
/
32768
.
0
;
#endif
p_in
--
;
p_out
--
;
}
#ifdef HAVE_SWAB
free
(
p_swabbed
);
#endif
p_out_buf
->
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
p_in_buf
->
i_nb_bytes
*
2
;
}
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