Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
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
Show 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 @@
...
@@ -3,7 +3,7 @@
* with endianness change
* with endianness change
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* 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>
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
* Henri Fallon <henri@videolan.org>
...
@@ -31,6 +31,11 @@
...
@@ -31,6 +31,11 @@
#include <string.h>
#include <string.h>
#include <vlc/vlc.h>
#include <vlc/vlc.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "audio_output.h"
#include "audio_output.h"
#include "aout_internal.h"
#include "aout_internal.h"
...
@@ -94,25 +99,29 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
...
@@ -94,25 +99,29 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
#ifdef HAVE_SWAB
#ifdef HAVE_SWAB
s16
*
p_swabbed
=
malloc
(
i
*
sizeof
(
s16
)
);
s16
*
p_swabbed
=
malloc
(
i
*
sizeof
(
s16
)
);
swab
(
p_in_buf
->
p_buffer
,
p_swabbed
,
swab
(
p_in_buf
->
p_buffer
,
p_swabbed
,
i
*
sizeof
(
s16
)
);
i
*
sizeof
(
s16
)
);
p_in
=
p_swabbed
+
i
-
1
;
p_in
=
p_swabbed
+
i
-
1
;
#else
#else
byte_t
temp
;
byte_t
p_tmp
[
2
]
;
#endif
#endif
while
(
i
--
)
while
(
i
--
)
{
{
#ifndef HAVE_SWAB
#ifndef HAVE_SWAB
temp
=
*
(
byte_t
*
)
p_in
;
p_tmp
[
0
]
=
((
byte_t
*
)
p_in
)[
1
]
;
*
(
byte_t
*
)
p_in
=
*
(
byte_t
*
)
p_in
+
1
;
p_tmp
[
1
]
=
((
byte_t
*
)
p_in
)[
0
]
;
*
(
byte_t
*
)
p_in
+
1
=
temp
;
*
p_out
=
(
float
)
*
p_tmp
/
32768
.
0
;
#e
ndif
#e
lse
*
p_out
=
(
float
)
*
p_in
/
32768
.
0
;
*
p_out
=
(
float
)
*
p_in
/
32768
.
0
;
#endif
p_in
--
;
p_out
--
;
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_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
p_in_buf
->
i_nb_bytes
*
2
;
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