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
b7ee1eea
Commit
b7ee1eea
authored
Jan 22, 2002
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed an alignment issue in the ac3 decoder.
parent
d970994c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
46 deletions
+31
-46
plugins/ac3_adec/ac3_adec.c
plugins/ac3_adec/ac3_adec.c
+29
-41
plugins/ac3_adec/ac3_adec.h
plugins/ac3_adec/ac3_adec.h
+1
-2
plugins/mpeg_adec/mpeg_adec.c
plugins/mpeg_adec/mpeg_adec.c
+1
-3
No files found.
plugins/ac3_adec/ac3_adec.c
View file @
b7ee1eea
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ac3_adec.c: ac3 decoder module main file
* ac3_adec.c: ac3 decoder module main file
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_adec.c,v 1.1
5 2002/01/21 23:57:4
6 massiot Exp $
* $Id: ac3_adec.c,v 1.1
6 2002/01/22 23:14:2
6 massiot Exp $
*
*
* Authors: Michel Lespinasse <walken@zoy.org>
* Authors: Michel Lespinasse <walken@zoy.org>
*
*
...
@@ -215,7 +215,7 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
...
@@ -215,7 +215,7 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
static
int
decoder_Run
(
decoder_config_t
*
p_config
)
static
int
decoder_Run
(
decoder_config_t
*
p_config
)
{
{
ac3dec_thread_t
*
p_ac3thread
;
ac3dec_thread_t
*
p_ac3thread
;
int
sync
;
boolean_t
b_sync
=
0
;
intf_DbgMsg
(
"ac3_adec debug: ac3_adec thread launched, initializing"
);
intf_DbgMsg
(
"ac3_adec debug: ac3_adec thread launched, initializing"
);
...
@@ -242,39 +242,36 @@ static int decoder_Run ( decoder_config_t * p_config )
...
@@ -242,39 +242,36 @@ static int decoder_Run ( decoder_config_t * p_config )
return
(
-
1
);
return
(
-
1
);
}
}
sync
=
0
;
p_ac3thread
->
sync_ptr
=
0
;
/* ac3 decoder thread's main loop */
/* ac3 decoder thread's main loop */
/* FIXME : do we have enough room to store the decoded frames ?? */
/* FIXME : do we have enough room to store the decoded frames ?? */
while
((
!
p_ac3thread
->
p_fifo
->
b_die
)
&&
(
!
p_ac3thread
->
p_fifo
->
b_error
))
while
((
!
p_ac3thread
->
p_fifo
->
b_die
)
&&
(
!
p_ac3thread
->
p_fifo
->
b_error
))
{
{
s16
*
buffer
;
s16
*
buffer
;
ac3_sync_info_t
sync_info
;
ac3_sync_info_t
sync_info
;
int
ptr
;
if
(
!
sync
)
{
do
{
GetBits
(
&
p_ac3thread
->
ac3_decoder
->
bit_stream
,
8
);
}
while
((
!
p_ac3thread
->
sync_ptr
)
&&
(
!
p_ac3thread
->
p_fifo
->
b_die
)
&&
(
!
p_ac3thread
->
p_fifo
->
b_error
));
ptr
=
p_ac3thread
->
sync_ptr
;
if
(
!
b_sync
)
while
(
ptr
--
&&
(
!
p_ac3thread
->
p_fifo
->
b_die
)
&&
(
!
p_ac3thread
->
p_fifo
->
b_error
))
{
{
p_ac3thread
->
ac3_decoder
->
bit_stream
.
p_byte
++
;
int
i_sync_ptr
;
}
#define p_bit_stream (&p_ac3thread->ac3_decoder->bit_stream)
/* we are in sync now */
/* Go to the next data packet and jump to sync_ptr */
sync
=
1
;
BitstreamNextDataPacket
(
p_bit_stream
);
i_sync_ptr
=
*
(
p_bit_stream
->
p_byte
-
2
)
<<
8
|
*
(
p_bit_stream
->
p_byte
-
1
);
p_bit_stream
->
p_byte
+=
i_sync_ptr
;
/* Empty the bit FIFO and realign the bit stream */
p_bit_stream
->
fifo
.
buffer
=
0
;
p_bit_stream
->
fifo
.
i_available
=
0
;
AlignWord
(
p_bit_stream
);
b_sync
=
1
;
#undef p_bit_stream
}
}
if
(
ac3_sync_frame
(
p_ac3thread
->
ac3_decoder
,
&
sync_info
))
if
(
ac3_sync_frame
(
p_ac3thread
->
ac3_decoder
,
&
sync_info
))
{
{
sync
=
0
;
b_
sync
=
0
;
goto
bad_fram
e
;
continu
e
;
}
}
/* Creating the audio output fifo if not created yet */
/* Creating the audio output fifo if not created yet */
...
@@ -331,8 +328,8 @@ static int decoder_Run ( decoder_config_t * p_config )
...
@@ -331,8 +328,8 @@ static int decoder_Run ( decoder_config_t * p_config )
if
(
ac3_decode_frame
(
p_ac3thread
->
ac3_decoder
,
buffer
))
if
(
ac3_decode_frame
(
p_ac3thread
->
ac3_decoder
,
buffer
))
{
{
sync
=
0
;
b_
sync
=
0
;
goto
bad_fram
e
;
continu
e
;
}
}
vlc_mutex_lock
(
&
p_ac3thread
->
p_aout_fifo
->
data_lock
);
vlc_mutex_lock
(
&
p_ac3thread
->
p_aout_fifo
->
data_lock
);
...
@@ -341,7 +338,6 @@ static int decoder_Run ( decoder_config_t * p_config )
...
@@ -341,7 +338,6 @@ static int decoder_Run ( decoder_config_t * p_config )
vlc_cond_signal
(
&
p_ac3thread
->
p_aout_fifo
->
data_wait
);
vlc_cond_signal
(
&
p_ac3thread
->
p_aout_fifo
->
data_wait
);
vlc_mutex_unlock
(
&
p_ac3thread
->
p_aout_fifo
->
data_lock
);
vlc_mutex_unlock
(
&
p_ac3thread
->
p_aout_fifo
->
data_lock
);
bad_frame:
RealignBits
(
&
p_ac3thread
->
ac3_decoder
->
bit_stream
);
RealignBits
(
&
p_ac3thread
->
ac3_decoder
->
bit_stream
);
}
}
...
@@ -420,19 +416,11 @@ static void EndThread (ac3dec_thread_t * p_ac3thread)
...
@@ -420,19 +416,11 @@ static void EndThread (ac3dec_thread_t * p_ac3thread)
* This function is called by input's NextDataPacket.
* This function is called by input's NextDataPacket.
*****************************************************************************/
*****************************************************************************/
static
void
BitstreamCallback
(
bit_stream_t
*
p_bit_stream
,
static
void
BitstreamCallback
(
bit_stream_t
*
p_bit_stream
,
boolean_t
b_new_pes
)
boolean_t
b_new_pes
)
{
{
ac3dec_thread_t
*
p_ac3thread
=
(
ac3dec_thread_t
*
)
p_bit_stream
->
p_callback_arg
;
if
(
b_new_pes
)
if
(
b_new_pes
)
{
{
int
ptr
;
/* Drop special AC3 header */
ptr
=
*
(
p_bit_stream
->
p_byte
+
1
);
ptr
<<=
8
;
ptr
|=
*
(
p_bit_stream
->
p_byte
+
2
);
p_ac3thread
->
sync_ptr
=
ptr
;
p_bit_stream
->
p_byte
+=
3
;
p_bit_stream
->
p_byte
+=
3
;
}
}
}
}
...
...
plugins/ac3_adec/ac3_adec.h
View file @
b7ee1eea
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ac3_adec.h : ac3 decoder thread interface
* ac3_adec.h : ac3 decoder thread interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_adec.h,v 1.
1 2001/11/13 12:09:17 henri
Exp $
* $Id: ac3_adec.h,v 1.
2 2002/01/22 23:14:26 massiot
Exp $
*
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
*
...
@@ -41,7 +41,6 @@ typedef struct ac3dec_thread_s
...
@@ -41,7 +41,6 @@ typedef struct ac3dec_thread_s
* Input properties
* Input properties
*/
*/
decoder_fifo_t
*
p_fifo
;
/* stores the PES stream data */
decoder_fifo_t
*
p_fifo
;
/* stores the PES stream data */
int
sync_ptr
;
/* sync ptr from ac3 magic header */
decoder_config_t
*
p_config
;
decoder_config_t
*
p_config
;
/*
/*
...
...
plugins/mpeg_adec/mpeg_adec.c
View file @
b7ee1eea
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* mpeg_adec.c: MPEG audio decoder thread
* mpeg_adec.c: MPEG audio decoder thread
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: mpeg_adec.c,v 1.1
5 2002/01/21 23:57:4
6 massiot Exp $
* $Id: mpeg_adec.c,v 1.1
6 2002/01/22 23:14:2
6 massiot Exp $
*
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
...
@@ -198,8 +198,6 @@ static void DecodeThread( adec_thread_t * p_adec )
...
@@ -198,8 +198,6 @@ static void DecodeThread( adec_thread_t * p_adec )
p_adec
->
i_sync
=
1
;
p_adec
->
i_sync
=
1
;
// p_adec->p_aout_fifo->l_rate = sync_info.sample_rate;
buffer
=
((
s16
*
)
p_adec
->
p_aout_fifo
->
buffer
)
buffer
=
((
s16
*
)
p_adec
->
p_aout_fifo
->
buffer
)
+
(
p_adec
->
p_aout_fifo
->
l_end_frame
*
ADEC_FRAME_SIZE
);
+
(
p_adec
->
p_aout_fifo
->
l_end_frame
*
ADEC_FRAME_SIZE
);
...
...
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