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
28e3d5e9
Commit
28e3d5e9
authored
Jan 25, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* faad : clean up.
parent
9137b014
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
71 deletions
+30
-71
modules/codec/faad/decoder.c
modules/codec/faad/decoder.c
+23
-50
modules/codec/faad/decoder.h
modules/codec/faad/decoder.h
+7
-21
No files found.
modules/codec/faad/decoder.c
View file @
28e3d5e9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* decoder.c: AAC decoder using libfaad2
* decoder.c: AAC decoder using libfaad2
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: decoder.c,v 1.
19 2003/01/25 16:59:49
fenrir Exp $
* $Id: decoder.c,v 1.
20 2003/01/25 18:09:30
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -132,35 +132,14 @@ static unsigned int pi_channels_maps[6] =
...
@@ -132,35 +132,14 @@ static unsigned int pi_channels_maps[6] =
#define FREE( p ) if( p != NULL ) free( p ); p = NULL
#define FREE( p ) if( p != NULL ) free( p ); p = NULL
#define GetWLE( p ) \
#define GetWLE( p ) \
( *(u
8*)(p) + ( *((u8
*)(p)+1) << 8 ) )
( *(u
int8_t*)(p) + ( *((uint8_t
*)(p)+1) << 8 ) )
#define GetDWLE( p ) \
#define GetDWLE( p ) \
( *(u
8*)(p) + ( *((u8
*)(p)+1) << 8 ) + \
( *(u
int8_t*)(p) + ( *((uint8_t
*)(p)+1) << 8 ) + \
( *((u
8*)(p)+2) << 16 ) + ( *((u8
*)(p)+3) << 24 ) )
( *((u
int8_t*)(p)+2) << 16 ) + ( *((uint8_t
*)(p)+3) << 24 ) )
static
void
faac_GetWaveFormatEx
(
waveformatex_t
*
p_wh
,
u8
*
p_data
)
{
WAVEFORMATEX
*
p_wfdata
=
(
WAVEFORMATEX
*
)
p_data
;
p_wh
->
i_formattag
=
p_wfdata
->
wFormatTag
;
p_wh
->
i_nb_channels
=
p_wfdata
->
nChannels
;
p_wh
->
i_samplespersec
=
p_wfdata
->
nSamplesPerSec
;
p_wh
->
i_avgbytespersec
=
p_wfdata
->
nAvgBytesPerSec
;
p_wh
->
i_blockalign
=
p_wfdata
->
nBlockAlign
;
p_wh
->
i_bitspersample
=
p_wfdata
->
wBitsPerSample
;
p_wh
->
i_size
=
p_wfdata
->
cbSize
;
if
(
p_wh
->
i_size
)
static
void
GetPESData
(
uint8_t
*
p_buf
,
int
i_max
,
pes_packet_t
*
p_pes
)
{
p_wh
->
p_data
=
malloc
(
p_wh
->
i_size
);
memcpy
(
p_wh
->
p_data
,
p_data
+
sizeof
(
WAVEFORMATEX
)
,
p_wh
->
i_size
);
}
}
static
void
GetPESData
(
u8
*
p_buf
,
int
i_max
,
pes_packet_t
*
p_pes
)
{
{
int
i_copy
;
int
i_copy
;
int
i_count
;
int
i_count
;
...
@@ -198,7 +177,7 @@ static void GetPESData( u8 *p_buf, int i_max, pes_packet_t *p_pes )
...
@@ -198,7 +177,7 @@ static void GetPESData( u8 *p_buf, int i_max, pes_packet_t *p_pes )
*****************************************************************************/
*****************************************************************************/
static
int
InitThread
(
adec_thread_t
*
p_adec
)
static
int
InitThread
(
adec_thread_t
*
p_adec
)
{
{
WAVEFORMATEX
*
p_wf
;
WAVEFORMATEX
wf
,
*
p_wf
;
int
i_status
;
int
i_status
;
unsigned
long
i_rate
;
unsigned
long
i_rate
;
unsigned
char
i_nb_channels
;
unsigned
char
i_nb_channels
;
...
@@ -209,12 +188,8 @@ static int InitThread( adec_thread_t * p_adec )
...
@@ -209,12 +188,8 @@ static int InitThread( adec_thread_t * p_adec )
{
{
msg_Warn
(
p_adec
->
p_fifo
,
msg_Warn
(
p_adec
->
p_fifo
,
"cannot load stream informations"
);
"cannot load stream informations"
);
memset
(
&
p_adec
->
format
,
0
,
sizeof
(
waveformatex_t
)
);
p_wf
=
&
wf
;
}
memset
(
p_wf
,
0
,
sizeof
(
WAVEFORMATEX
)
);
else
{
faac_GetWaveFormatEx
(
&
p_adec
->
format
,
(
uint8_t
*
)
p_wf
);
}
}
p_adec
->
p_buffer
=
NULL
;
p_adec
->
p_buffer
=
NULL
;
...
@@ -225,11 +200,10 @@ static int InitThread( adec_thread_t * p_adec )
...
@@ -225,11 +200,10 @@ static int InitThread( adec_thread_t * p_adec )
{
{
msg_Err
(
p_adec
->
p_fifo
,
msg_Err
(
p_adec
->
p_fifo
,
"cannot initialize faad"
);
"cannot initialize faad"
);
FREE
(
p_adec
->
format
.
p_data
);
return
(
-
1
);
return
(
-
1
);
}
}
if
(
p_
adec
->
format
.
p_data
==
NULL
)
if
(
p_
wf
->
cbSize
<=
0
)
{
{
int
i_frame_size
;
int
i_frame_size
;
pes_packet_t
*
p_pes
;
pes_packet_t
*
p_pes
;
...
@@ -273,8 +247,8 @@ static int InitThread( adec_thread_t * p_adec )
...
@@ -273,8 +247,8 @@ static int InitThread( adec_thread_t * p_adec )
else
else
{
{
i_status
=
faacDecInit2
(
p_adec
->
p_handle
,
i_status
=
faacDecInit2
(
p_adec
->
p_handle
,
p_adec
->
format
.
p_data
,
(
uint8_t
*
)
&
p_wf
[
1
]
,
p_
adec
->
format
.
i_s
ize
,
p_
wf
->
cbS
ize
,
&
i_rate
,
&
i_rate
,
&
i_nb_channels
);
&
i_nb_channels
);
}
}
...
@@ -467,7 +441,6 @@ static void EndThread (adec_thread_t *p_adec)
...
@@ -467,7 +441,6 @@ static void EndThread (adec_thread_t *p_adec)
faacDecClose
(
p_adec
->
p_handle
);
faacDecClose
(
p_adec
->
p_handle
);
}
}
FREE
(
p_adec
->
format
.
p_data
);
FREE
(
p_adec
->
p_buffer
);
FREE
(
p_adec
->
p_buffer
);
msg_Dbg
(
p_adec
->
p_fifo
,
"faad decoder closed"
);
msg_Dbg
(
p_adec
->
p_fifo
,
"faad decoder closed"
);
...
...
modules/codec/faad/decoder.h
View file @
28e3d5e9
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: decoder.h,v 1.
5 2002/11/14 22:38:47 massiot
Exp $
* $Id: decoder.h,v 1.
6 2003/01/25 18:09:30 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -24,23 +24,9 @@
...
@@ -24,23 +24,9 @@
#define AAC_MAXCHANNELS 64
#define AAC_MAXCHANNELS 64
typedef
struct
waveformatex_s
{
u16
i_formattag
;
u16
i_nb_channels
;
u32
i_samplespersec
;
u32
i_avgbytespersec
;
u16
i_blockalign
;
u16
i_bitspersample
;
u16
i_size
;
/* the extra size in bytes */
u8
*
p_data
;
/* The extra data */
}
waveformatex_t
;
typedef
struct
adec_thread_s
typedef
struct
adec_thread_s
{
{
waveformatex_t
format
;
/*
/*
* faad decoder session
* faad decoder session
*/
*/
...
@@ -55,7 +41,7 @@ typedef struct adec_thread_s
...
@@ -55,7 +41,7 @@ typedef struct adec_thread_s
*/
*/
decoder_fifo_t
*
p_fifo
;
decoder_fifo_t
*
p_fifo
;
u
8
*
p_buffer
;
u
int8_t
*
p_buffer
;
int
i_buffer
;
int
i_buffer
;
/*
/*
...
...
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