Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
5c196547
Commit
5c196547
authored
Jun 22, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* faad: can read stream with multiple frames per pes_packet_t (for mkv).
parent
57b971e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
87 deletions
+97
-87
modules/codec/faad/decoder.c
modules/codec/faad/decoder.c
+97
-87
No files found.
modules/codec/faad/decoder.c
View file @
5c196547
...
@@ -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.2
4 2003/06/14 22:14:16 hartman
Exp $
* $Id: decoder.c,v 1.2
5 2003/06/22 08:49:11 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -120,14 +120,17 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
...
@@ -120,14 +120,17 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
return
(
0
);
return
(
0
);
}
}
static
unsigned
int
pi_channels_maps
[
6
]
=
static
unsigned
int
pi_channels_maps
[
7
]
=
{
{
0
,
0
,
AOUT_CHAN_CENTER
,
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
,
AOUT_CHAN_CENTER
,
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
,
AOUT_CHAN_CENTER
|
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
,
AOUT_CHAN_CENTER
|
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
,
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
,
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
,
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_CENTER
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_CENTER
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
,
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
/* FIXME */
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_CENTER
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
|
AOUT_CHAN_REARCENTER
,
};
};
#define FREE( p ) if( p != NULL ) free( p ); p = NULL
#define FREE( p ) if( p != NULL ) free( p ); p = NULL
...
@@ -316,6 +319,7 @@ static void DecodeThread( adec_thread_t *p_adec )
...
@@ -316,6 +319,7 @@ static void DecodeThread( adec_thread_t *p_adec )
faacDecFrameInfo
faad_frame
;
faacDecFrameInfo
faad_frame
;
int
i_frame_size
;
int
i_frame_size
;
pes_packet_t
*
p_pes
;
pes_packet_t
*
p_pes
;
int
i_used
;
/* **** Get a new frames from streams **** */
/* **** Get a new frames from streams **** */
do
do
...
@@ -346,16 +350,20 @@ static void DecodeThread( adec_thread_t *p_adec )
...
@@ -346,16 +350,20 @@ static void DecodeThread( adec_thread_t *p_adec )
input_DeletePES
(
p_adec
->
p_fifo
->
p_packets_mgt
,
p_pes
);
input_DeletePES
(
p_adec
->
p_fifo
->
p_packets_mgt
,
p_pes
);
}
while
(
i_frame_size
<=
0
);
}
while
(
i_frame_size
<=
0
);
i_used
=
0
;
while
(
i_used
<
i_frame_size
)
{
/* **** decode this frame **** */
/* **** decode this frame **** */
#ifdef HAVE_OLD_FAAD2
#ifdef HAVE_OLD_FAAD2
p_faad_buffer
=
faacDecDecode
(
p_adec
->
p_handle
,
p_faad_buffer
=
faacDecDecode
(
p_adec
->
p_handle
,
&
faad_frame
,
&
faad_frame
,
p_adec
->
p_buffer
);
&
p_adec
->
p_buffer
[
i_used
]
);
#else
#else
p_faad_buffer
=
faacDecDecode
(
p_adec
->
p_handle
,
p_faad_buffer
=
faacDecDecode
(
p_adec
->
p_handle
,
&
faad_frame
,
&
faad_frame
,
p_adec
->
p_buffer
,
&
p_adec
->
p_buffer
[
i_used
]
,
i_frame_size
);
i_frame_size
-
i_used
);
#endif
#endif
/* **** some sanity checks to see if we have samples to out **** */
/* **** some sanity checks to see if we have samples to out **** */
...
@@ -367,7 +375,7 @@ static void DecodeThread( adec_thread_t *p_adec )
...
@@ -367,7 +375,7 @@ static void DecodeThread( adec_thread_t *p_adec )
}
}
if
(
(
faad_frame
.
channels
<=
0
)
||
if
(
(
faad_frame
.
channels
<=
0
)
||
(
faad_frame
.
channels
>
AAC_MAXCHANNELS
)
||
(
faad_frame
.
channels
>
AAC_MAXCHANNELS
)
||
(
faad_frame
.
channels
>
5
)
)
(
faad_frame
.
channels
>
6
)
)
{
{
msg_Warn
(
p_adec
->
p_fifo
,
msg_Warn
(
p_adec
->
p_fifo
,
"invalid channels count(%d)"
,
faad_frame
.
channels
);
"invalid channels count(%d)"
,
faad_frame
.
channels
);
...
@@ -386,6 +394,7 @@ static void DecodeThread( adec_thread_t *p_adec )
...
@@ -386,6 +394,7 @@ static void DecodeThread( adec_thread_t *p_adec )
faad_frame.channels,
faad_frame.channels,
faad_frame.bytesconsumed );
faad_frame.bytesconsumed );
#endif
#endif
i_used
+=
faad_frame
.
bytesconsumed
;
/* **** Now we can output these samples **** */
/* **** Now we can output these samples **** */
...
@@ -444,6 +453,7 @@ static void DecodeThread( adec_thread_t *p_adec )
...
@@ -444,6 +453,7 @@ static void DecodeThread( adec_thread_t *p_adec )
p_aout_buffer
->
i_nb_bytes
);
p_aout_buffer
->
i_nb_bytes
);
aout_DecPlay
(
p_adec
->
p_aout
,
p_adec
->
p_aout_input
,
p_aout_buffer
);
aout_DecPlay
(
p_adec
->
p_aout
,
p_adec
->
p_aout_input
,
p_aout_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