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
febe55b8
Commit
febe55b8
authored
Nov 22, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/audio_output/directx.c: backported directx audio output fix from trunk (#13322).
parent
b4ab7eab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
33 deletions
+33
-33
modules/audio_output/directx.c
modules/audio_output/directx.c
+24
-33
modules/video_filter/marq.c
modules/video_filter/marq.c
+9
-0
No files found.
modules/audio_output/directx.c
View file @
febe55b8
...
...
@@ -38,8 +38,8 @@
#include <mmsystem.h>
#include <dsound.h>
#define FRAME_SIZE
2048
/* The size is in samples, not in byt
es */
#define FRAMES_NUM 8
#define FRAME_SIZE
((int)p_aout->output.output.i_rate/20)
/* Size in sampl
es */
#define FRAMES_NUM 8
/* Needs to be > 3 */
/* frame buffer status */
#define FRAME_QUEUED 0
...
...
@@ -1038,7 +1038,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
HANDLE
notification_events
[
FRAMES_NUM
];
HRESULT
dsresult
;
aout_instance_t
*
p_aout
=
p_notif
->
p_aout
;
int
i
,
i_which_frame
,
i_last_frame
,
i_next_frame
;
int
i
,
i_which_frame
,
i_last_frame
;
mtime_t
mtime
;
vlc_bool_t
b_sleek
;
...
...
@@ -1083,7 +1083,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
while
(
!
p_notif
->
b_die
)
{
aout_buffer_t
*
p_buffer
;
long
l_
latency
;
long
l_
position
,
l_latency
=
0
;
/* wait for the position notification */
i_which_frame
=
WaitForMultipleObjects
(
FRAMES_NUM
,
...
...
@@ -1098,52 +1098,43 @@ static void DirectSoundThread( notification_thread_t *p_notif )
/* We take into account the current latency */
if
SUCCEEDED
(
IDirectSoundBuffer_GetCurrentPosition
(
p_aout
->
output
.
p_sys
->
p_dsbuffer
,
&
l_
latency
,
NULL
)
)
&
l_
position
,
NULL
)
)
{
if
(
l_latency
>
(
i_which_frame
*
FRAME_SIZE
)
&&
l_latency
<
((
i_which_frame
+
1
)
*
FRAME_SIZE
)
)
{
l_latency
=
-
(
l_latency
/
p_aout
->
output
.
output
.
i_bytes_per_frame
%
FRAME_SIZE
);
}
else
{
l_latency
=
FRAME_SIZE
-
(
l_latency
/
p_aout
->
output
.
output
.
i_bytes_per_frame
%
FRAME_SIZE
);
}
}
else
{
l_latency
=
0
;
/* Latency is in samples */
l_position
/=
p_aout
->
output
.
output
.
i_bytes_per_frame
;
l_latency
=
l_position
-
i_which_frame
*
FRAME_SIZE
;
/* That sucks but latency can apparently be negative up to -FRAME_SIZE
* ie. the notification is done in advance. */
if
(
l_latency
>
FRAME_SIZE
*
(
FRAMES_NUM
-
1
)
)
l_latency
-=
(
FRAME_SIZE
*
FRAMES_NUM
);
else
if
(
l_latency
<
-
FRAME_SIZE
)
l_latency
+=
(
FRAME_SIZE
*
FRAMES_NUM
);
}
/* Mark last frame as empty */
i_last_frame
=
(
i_which_frame
+
FRAMES_NUM
-
1
)
%
FRAMES_NUM
;
i_next_frame
=
(
i_which_frame
+
1
)
%
FRAMES_NUM
;
p_notif
->
i_frame_status
[
i_last_frame
]
=
FRAME_EMPTY
;
/* Try to fill in as many frame buffers as possible */
for
(
i
=
i_
next_frame
;
(
i
%
FRAMES_NUM
)
!=
i_which_frame
;
i
++
)
for
(
i
=
i_
which_frame
+
1
;
i
<
i_which_frame
+
FRAMES_NUM
;
i
++
)
{
/* Check if frame buf is already filled */
if
(
p_notif
->
i_frame_status
[
i
%
FRAMES_NUM
]
==
FRAME_QUEUED
)
continue
;
if
(
((
i
-
i_which_frame
)
*
FRAME_SIZE
-
l_latency
)
<
0
)
{
msg_Warn
(
p_aout
,
"dectected underrun!"
);
}
p_buffer
=
aout_OutputNextBuffer
(
p_aout
,
mtime
+
1000000
/
p_aout
->
output
.
output
.
i_rate
*
((
i
-
i_next_frame
+
1
)
*
FRAME_SIZE
+
l_latency
)
,
b_sleek
);
mtime
+
I64C
(
1000000
)
*
((
i
-
i_which_frame
)
*
FRAME_SIZE
-
l_latency
)
/
p_aout
->
output
.
output
.
i_rate
,
b_sleek
);
/* If there is no audio data available and we have some buffered
* already, then just wait for the next time */
if
(
!
p_buffer
&&
(
i
!=
i_next_frame
)
)
{
//msg_Err( p_aout, "only %i frame buffers filled!",
// i - i_next_frame );
break
;
}
if
(
!
p_buffer
&&
(
i
!=
i_which_frame
+
1
)
)
break
;
if
(
FillBuffer
(
p_aout
,
(
i
%
FRAMES_NUM
),
p_buffer
)
!=
VLC_SUCCESS
)
...
...
modules/video_filter/marq.c
View file @
febe55b8
...
...
@@ -212,6 +212,15 @@ static void DestroyFilter( vlc_object_t *p_this )
{
return
;
}
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-x"
,
MarqueeCallback
,
p_sys
);
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-y"
,
MarqueeCallback
,
p_sys
);
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-marquee"
,
MarqueeCallback
,
p_sys
);
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-timeout"
,
MarqueeCallback
,
p_sys
);
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-position"
,
MarqueeCallback
,
p_sys
);
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-color"
,
MarqueeCallback
,
p_sys
);
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-opacity"
,
MarqueeCallback
,
p_sys
);
var_DelCallback
(
p_input
->
p_libvlc
,
"marq-size"
,
MarqueeCallback
,
p_sys
);
var_Destroy
(
p_input
->
p_libvlc
,
"marq-marquee"
);
var_Destroy
(
p_input
->
p_libvlc
,
"marq-x"
);
var_Destroy
(
p_input
->
p_libvlc
,
"marq-y"
);
...
...
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