Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
acd42fb5
Commit
acd42fb5
authored
Nov 03, 2012
by
Edward Wang
Committed by
Jean-Baptiste Kempf
Nov 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oss: Compilation fixes and cleanup
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
b04188b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
modules/audio_output/oss.c
modules/audio_output/oss.c
+14
-11
No files found.
modules/audio_output/oss.c
View file @
acd42fb5
...
...
@@ -56,6 +56,7 @@ struct aout_sys_t
uint8_t
level
;
bool
mute
;
bool
starting
;
audio_sample_format_t
format
;
};
static
int
Open
(
vlc_object_t
*
);
...
...
@@ -94,7 +95,7 @@ static int DeviceChanged (vlc_object_t *obj, const char *varname,
static
int
Start
(
audio_output_t
*
aout
,
audio_sample_format_t
*
restrict
fmt
)
{
a
udio_output_t
*
aout
=
(
audio_output_t
*
)
obj
;
a
out_sys_t
*
sys
=
aout
->
sys
;
/* Open the device */
const
char
*
device
;
...
...
@@ -114,11 +115,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
free
(
devicebuf
);
return
VLC_EGENERIC
;
}
aout_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
if
(
unlikely
(
sys
==
NULL
))
goto
error
;
aout
->
sys
=
sys
;
sys
->
fd
=
fd
;
/* Select audio format */
...
...
@@ -288,8 +284,10 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
}
}
sys
->
format
=
*
fmt
;
free
(
devicebuf
);
return
0
;
return
VLC_SUCCESS
;
error:
free
(
sys
);
close
(
fd
);
...
...
@@ -305,8 +303,8 @@ static void Stop (audio_output_t *aout)
aout_sys_t
*
sys
=
aout
->
sys
;
int
fd
=
sys
->
fd
;
var_DelCallback
(
obj
,
"audio-device"
,
DeviceChanged
,
NULL
);
var_Destroy
(
obj
,
"audio-device"
);
var_DelCallback
(
aout
,
"audio-device"
,
DeviceChanged
,
NULL
);
var_Destroy
(
aout
,
"audio-device"
);
ioctl
(
fd
,
SNDCTL_DSP_HALT
,
NULL
);
close
(
fd
);
...
...
@@ -325,8 +323,8 @@ static void Play (audio_output_t *aout, block_t *block,
int
delay
;
if
(
ioctl
(
sys
->
fd
,
SNDCTL_DSP_GETODELAY
,
&
delay
)
>=
0
)
{
mtime_t
latency
=
(
delay
*
CLOCK_FREQ
*
aout
->
format
.
i_frame_length
)
/
(
aout
->
format
.
i_rate
*
aout
->
format
.
i_bytes_per_frame
);
mtime_t
latency
=
(
delay
*
CLOCK_FREQ
*
sys
->
format
.
i_frame_length
)
/
(
sys
->
format
.
i_rate
*
sys
->
format
.
i_bytes_per_frame
);
*
drift
=
mdate
()
+
latency
-
block
->
i_pts
;
}
else
...
...
@@ -446,7 +444,12 @@ static int Open (vlc_object_t *obj)
{
audio_output_t
*
aout
=
(
audio_output_t
*
)
obj
;
aout_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
if
(
unlikely
(
sys
==
NULL
))
return
VLC_ENOMEM
;
/* FIXME: set volume/mute here */
aout
->
sys
=
sys
;
aout
->
start
=
Start
;
aout
->
stop
=
Stop
;
return
VLC_SUCCESS
;
...
...
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