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
a7e097b4
Commit
a7e097b4
authored
May 17, 2002
by
Stéphane Borel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*check for b_die and b_error in all loops so that we don't remain stuck
waiting for data whereas the vlc has tried to quit.
parent
3425b2e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
15 deletions
+36
-15
plugins/ac3_spdif/ac3_spdif.c
plugins/ac3_spdif/ac3_spdif.c
+21
-7
src/audio_output/aout_spdif.c
src/audio_output/aout_spdif.c
+15
-8
No files found.
plugins/ac3_spdif/ac3_spdif.c
View file @
a7e097b4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.2
3 2002/04/23 14:16:20 sam
Exp $
* $Id: ac3_spdif.c,v 1.2
4 2002/05/17 18:01:25 stef
Exp $
*
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
* Juha Yrjola <jyrjola@cc.hut.fi>
...
@@ -223,9 +223,13 @@ static int decoder_Run( decoder_config_t * p_config )
...
@@ -223,9 +223,13 @@ static int decoder_Run( decoder_config_t * p_config )
* Therefore a non-zero value after a call to GetBits() means the PES
* Therefore a non-zero value after a call to GetBits() means the PES
* has changed. */
* has changed. */
b_sync
=
0
;
b_sync
=
0
;
while
(
!
b_sync
)
while
(
!
p_spdif
->
p_fifo
->
b_die
&&
!
p_spdif
->
p_fifo
->
b_error
&&
!
b_sync
)
{
{
while
(
GetBits
(
&
p_spdif
->
bit_stream
,
8
)
!=
0x0b
);
while
(
!
p_spdif
->
p_fifo
->
b_die
&&
!
p_spdif
->
p_fifo
->
b_error
&&
GetBits
(
&
p_spdif
->
bit_stream
,
8
)
!=
0x0b
);
p_spdif
->
i_real_pts
=
p_spdif
->
i_pts
;
p_spdif
->
i_real_pts
=
p_spdif
->
i_pts
;
p_spdif
->
i_pts
=
0
;
p_spdif
->
i_pts
=
0
;
b_sync
=
(
ShowBits
(
&
p_spdif
->
bit_stream
,
8
)
==
0x77
);
b_sync
=
(
ShowBits
(
&
p_spdif
->
bit_stream
,
8
)
==
0x77
);
...
@@ -273,13 +277,23 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
...
@@ -273,13 +277,23 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
BitstreamCallback
,
(
void
*
)
p_spdif
);
BitstreamCallback
,
(
void
*
)
p_spdif
);
/* Find syncword */
/* Find syncword */
while
(
!
b_sync
)
while
(
!
p_spdif
->
p_fifo
->
b_die
&&
!
p_spdif
->
p_fifo
->
b_error
&&
!
b_sync
)
{
{
while
(
GetBits
(
&
p_spdif
->
bit_stream
,
8
)
!=
0x0b
);
while
(
!
p_spdif
->
p_fifo
->
b_die
&&
!
p_spdif
->
p_fifo
->
b_error
&&
GetBits
(
&
p_spdif
->
bit_stream
,
8
)
!=
0x0b
);
p_spdif
->
i_real_pts
=
p_spdif
->
i_pts
;
p_spdif
->
i_real_pts
=
p_spdif
->
i_pts
;
p_spdif
->
i_pts
=
0
;
p_spdif
->
i_pts
=
0
;
b_sync
=
(
ShowBits
(
&
p_spdif
->
bit_stream
,
8
)
==
0x77
);
b_sync
=
(
ShowBits
(
&
p_spdif
->
bit_stream
,
8
)
==
0x77
);
}
}
if
(
p_spdif
->
p_fifo
->
b_die
||
p_spdif
->
p_fifo
->
b_error
)
{
return
-
1
;
}
RemoveBits
(
&
p_spdif
->
bit_stream
,
8
);
RemoveBits
(
&
p_spdif
->
bit_stream
,
8
);
/* Check stream properties */
/* Check stream properties */
...
@@ -362,8 +376,8 @@ static void EndThread( ac3_spdif_thread_t * p_spdif )
...
@@ -362,8 +376,8 @@ static void EndThread( ac3_spdif_thread_t * p_spdif )
*****************************************************************************
*****************************************************************************
* 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
)
{
{
ac3_spdif_thread_t
*
p_spdif
;
ac3_spdif_thread_t
*
p_spdif
;
...
...
src/audio_output/aout_spdif.c
View file @
a7e097b4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* aout_spdif.c: AC3 passthrough output
* aout_spdif.c: AC3 passthrough output
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: aout_spdif.c,v 1.2
6 2002/03/15 01:47:16
stef Exp $
* $Id: aout_spdif.c,v 1.2
7 2002/05/17 18:01:25
stef Exp $
*
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
...
@@ -93,17 +93,20 @@ void aout_SpdifThread( aout_thread_t * p_aout )
...
@@ -93,17 +93,20 @@ void aout_SpdifThread( aout_thread_t * p_aout )
int
i_fifo
;
int
i_fifo
;
mtime_t
m_frame_time
=
0
;
mtime_t
m_frame_time
=
0
;
mtime_t
m_play
;
mtime_t
m_play
;
mtime_t
m_old
;
while
(
!
p_aout
->
b_die
)
while
(
!
p_aout
->
b_die
)
{
{
i_fifo
=
0
;
i_fifo
=
0
;
/* Find spdif fifo */
/* Find spdif fifo */
while
(
(
p_aout
->
fifo
[
i_fifo
].
i_format
!=
AOUT_FIFO_SPDIF
)
&&
while
(
(
p_aout
->
fifo
[
i_fifo
].
i_format
!=
AOUT_FIFO_SPDIF
)
&&
(
i_fifo
<
AOUT_MAX_FIFOS
)
)
(
i_fifo
<
AOUT_MAX_FIFOS
)
&&
!
p_aout
->
b_die
)
{
{
i_fifo
++
;
i_fifo
++
;
}
}
m_old
=
0
;
while
(
!
p_aout
->
b_die
&&
while
(
!
p_aout
->
b_die
&&
!
p_aout
->
fifo
[
i_fifo
].
b_die
)
!
p_aout
->
fifo
[
i_fifo
].
b_die
)
{
{
...
@@ -133,7 +136,6 @@ void aout_SpdifThread( aout_thread_t * p_aout )
...
@@ -133,7 +136,6 @@ void aout_SpdifThread( aout_thread_t * p_aout )
* dsp buffer is empty enough to accept the data */
* dsp buffer is empty enough to accept the data */
if
(
m_play
>
(
mdate
()
-
m_frame_time
)
)
if
(
m_play
>
(
mdate
()
-
m_frame_time
)
)
{
{
#if 0
/* check continuity */
/* check continuity */
if
(
(
m_play
-
m_old
)
!=
m_frame_time
)
if
(
(
m_play
-
m_old
)
!=
m_frame_time
)
{
{
...
@@ -144,9 +146,7 @@ void aout_SpdifThread( aout_thread_t * p_aout )
...
@@ -144,9 +146,7 @@ void aout_SpdifThread( aout_thread_t * p_aout )
mwait
(
m_play
-
2
*
m_frame_time
);
mwait
(
m_play
-
2
*
m_frame_time
);
}
}
m_old
=
m_play
;
m_old
=
m_play
;
#else
mwait
(
m_play
-
m_frame_time
);
#endif
p_aout
->
pf_getbufinfo
(
p_aout
,
0
);
p_aout
->
pf_getbufinfo
(
p_aout
,
0
);
p_aout
->
pf_play
(
p_aout
,
(
byte_t
*
)
p_aout
->
buffer
,
p_aout
->
pf_play
(
p_aout
,
(
byte_t
*
)
p_aout
->
buffer
,
...
@@ -155,9 +155,16 @@ void aout_SpdifThread( aout_thread_t * p_aout )
...
@@ -155,9 +155,16 @@ void aout_SpdifThread( aout_thread_t * p_aout )
}
}
else
else
{
{
vlc_mutex_unlock
(
&
p_aout
->
fifo
[
i_fifo
].
data_lock
);
msleep
(
m_frame_time
);
intf_WarnMsg
(
3
,
"aout warning: empty spdif fifo"
);
intf_WarnMsg
(
3
,
"aout warning: empty spdif fifo"
);
while
(
AOUT_FIFO_ISEMPTY
(
p_aout
->
fifo
[
i_fifo
]
)
&&
!
p_aout
->
b_die
&&
!
p_aout
->
fifo
[
i_fifo
].
b_die
)
{
vlc_mutex_unlock
(
&
p_aout
->
fifo
[
i_fifo
].
data_lock
);
msleep
(
m_frame_time
);
vlc_mutex_lock
(
&
p_aout
->
fifo
[
i_fifo
].
data_lock
);
}
}
}
}
}
...
...
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