Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
c36ef28a
Commit
c36ef28a
authored
Aug 31, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OSS: synchronize start of playback (fixes: #7213)
This is untested as the bug could not be reproduced locally.
parent
27c1188f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
modules/audio_output/oss.c
modules/audio_output/oss.c
+15
-1
No files found.
modules/audio_output/oss.c
View file @
c36ef28a
...
...
@@ -55,6 +55,7 @@ struct aout_sys_t
int
fd
;
uint8_t
level
;
bool
mute
;
bool
starting
;
};
static
int
Open
(
vlc_object_t
*
);
...
...
@@ -250,6 +251,7 @@ static int Open (vlc_object_t *obj)
aout
->
mute_set
=
MuteSet
;
}
}
sys
->
starting
=
true
;
/* Build the devices list */
var_Create
(
aout
,
"audio-device"
,
VLC_VAR_STRING
|
VLC_VAR_HASCHOICE
);
...
...
@@ -329,12 +331,24 @@ static void Play (audio_output_t *aout, block_t *block,
{
mtime_t
latency
=
(
delay
*
CLOCK_FREQ
*
aout
->
format
.
i_frame_length
)
/
(
aout
->
format
.
i_rate
*
aout
->
format
.
i_bytes_per_frame
);
/* TODO: insert zeroes when starting playback */
*
drift
=
mdate
()
+
latency
-
block
->
i_pts
;
}
else
msg_Warn
(
aout
,
"cannot get delay: %m"
);
if
(
sys
->
starting
)
{
/* Start on time */
/* TODO: resync on pause resumption and underflow recovery */
mtime_t
delta
=
-*
drift
;
if
(
delta
>
0
)
{
msg_Dbg
(
aout
,
"deferring start (%"
PRId64
" us)"
,
delta
);
msleep
(
delta
);
*
drift
=
0
;
}
else
msg_Warn
(
aout
,
"starting late (%"
PRId64
" us)"
,
delta
);
sys
->
starting
=
false
;
}
while
(
block
->
i_buffer
>
0
)
{
ssize_t
bytes
=
write
(
fd
,
block
->
p_buffer
,
block
->
i_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