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
e57dfae1
Commit
e57dfae1
authored
Aug 05, 2001
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Minor bug fix to aout_directx.c
parent
85c3dbc4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
plugins/directx/aout_directx.c
plugins/directx/aout_directx.c
+22
-10
No files found.
plugins/directx/aout_directx.c
View file @
e57dfae1
...
...
@@ -2,7 +2,7 @@
* aout_directx.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: aout_directx.c,v 1.
9 2001/08/05 15:32:46
gbazin Exp $
* $Id: aout_directx.c,v 1.
10 2001/08/05 18:57:59
gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -356,9 +356,6 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
if
(
p_aout
->
p_sys
->
b_buffer_underflown
)
{
/* reset the position to the beginning of the buffer */
dsresult
=
IDirectSoundBuffer_SetCurrentPosition
(
p_aout
->
p_sys
->
p_dsbuffer
,
1024
);
/* there has been an underflow so we need to play the new sample
* as soon as possible. This is why we query the play position */
dsresult
=
IDirectSoundBuffer_GetCurrentPosition
(
...
...
@@ -371,11 +368,26 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
p_aout
->
p_sys
->
l_write_position
=
0
;
}
intf_WarnMsg
(
3
,
"aout: aout_Play underflow"
);
/* reinitialise the underflow detection counters */
p_aout
->
p_sys
->
l_data_written_from_beginning
=
0
;
p_aout
->
p_sys
->
l_data_played_from_beginning
=
-
(
p_aout
->
p_sys
->
l_write_position
%
(
p_aout
->
p_sys
->
l_buffer_size
/
2
));
p_aout
->
p_sys
->
b_buffer_underflown
=
0
;
p_aout
->
p_sys
->
l_data_written_from_beginning
=
0
;
#define WRITE_P p_aout->p_sys->l_write_position
#define PLAY_P l_play_position
#define BUF_SIZE p_aout->p_sys->l_buffer_size
p_aout
->
p_sys
->
l_data_played_from_beginning
=
-
(
WRITE_P
%
(
BUF_SIZE
/
2
));
if
(
PLAY_P
<
BUF_SIZE
/
2
&&
WRITE_P
>
BUF_SIZE
/
2
)
{
p_aout
->
p_sys
->
l_data_played_from_beginning
-=
(
BUF_SIZE
/
2
);
}
if
(
PLAY_P
>
BUF_SIZE
/
2
&&
WRITE_P
<
BUF_SIZE
/
2
)
{
p_aout
->
p_sys
->
l_data_played_from_beginning
-=
(
BUF_SIZE
/
2
);
}
#undef WRITE_P
#undef PLAY_P
#undef BUF_SIZE
}
/* Before copying anything, we have to lock the buffer */
...
...
@@ -710,17 +722,19 @@ static void DirectSoundThread( aout_thread_t *p_aout )
/* detect wrap-around */
if
(
l_data_in_buffer
<
(
-
l_buffer_size
/
2
)
)
{
intf_WarnMsg
(
3
,
"aout: DirectSoundThread wrap around: %li"
,
l_data_in_buffer
);
l_data_in_buffer
+=
l_buffer_size
;
}
/* detect underflow */
if
(
l_data_in_buffer
<=
0
)
{
intf_WarnMsg
(
3
,
"aout: DirectSoundThread underflow
"
);
intf_WarnMsg
(
3
,
"aout: DirectSoundThread underflow
: %li"
,
l_data_in_buffer
);
p_aout
->
p_sys
->
b_buffer_underflown
=
1
;
p_aout
->
p_sys
->
l_write_position
=
(
l_play_position
+
l_buffer_size
/
2
)
%
l_buffer_size
;
l_data_in_buffer
=
l_buffer_size
/
2
;
p_aout
->
p_sys
->
l_data_played_from_beginning
-=
(
l_buffer_size
/
2
);
}
...
...
@@ -776,5 +790,3 @@ static void DirectSoundThread( aout_thread_t *p_aout )
intf_WarnMsg
(
3
,
"aout: DirectSoundThread exiting"
);
}
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