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
f7fe7837
Commit
f7fe7837
authored
May 12, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ios audio unit: minor fixes
parent
7d28f8a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
modules/audio_output/audiounit_ios.c
modules/audio_output/audiounit_ios.c
+8
-2
No files found.
modules/audio_output/audiounit_ios.c
View file @
f7fe7837
...
...
@@ -292,6 +292,10 @@ static void Stop(audio_output_t *p_aout)
if
(
status
!=
noErr
)
msg_Warn
(
p_aout
,
"failed to stop AudioUnit (%i)"
,
(
int
)
status
);
status
=
AudioUnitUninitialize
(
p_sys
->
au_unit
);
if
(
status
!=
noErr
)
msg_Warn
(
p_aout
,
"failed to uninit AudioUnit (%i)"
,
(
int
)
status
);
status
=
AudioComponentInstanceDispose
(
p_sys
->
au_unit
);
if
(
status
!=
noErr
)
msg_Warn
(
p_aout
,
"failed to dispose Audio Component instance (%i)"
,
(
int
)
status
);
...
...
@@ -340,10 +344,10 @@ static void Pause (audio_output_t *p_aout, bool pause, mtime_t date)
AudioOutputUnitStop
(
p_sys
->
au_unit
);
AudioSessionSetActive
(
false
);
}
else
{
AudioOutputUnitStart
(
p_sys
->
au_unit
);
UInt32
sessionCategory
=
kAudioSessionCategory_MediaPlayback
;
AudioSessionSetProperty
(
kAudioSessionProperty_AudioCategory
,
sizeof
(
sessionCategory
),
&
sessionCategory
);
AudioSessionSetActive
(
true
);
AudioOutputUnitStart
(
p_sys
->
au_unit
);
}
}
...
...
@@ -411,11 +415,13 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
/* Pull audio from buffer */
int32_t
availableBytes
;
Float32
*
buffer
=
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
);
if
(
unlikely
(
bytesRequested
==
0
))
/* cannot be negative */
return
noErr
;
/* check if we have enough data */
if
(
!
availableBytes
||
p_sys
->
b_paused
)
{
/* return an empty buffer so silence is played until we have data */
memset
(
targetBuffer
,
0
,
ioData
->
mBuffers
[
0
].
mDataByteSize
);
memset
(
targetBuffer
,
0
,
bytesRequested
);
}
else
{
int32_t
bytesToCopy
=
__MIN
(
bytesRequested
,
availableBytes
);
...
...
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