Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
fbf8ac7d
Commit
fbf8ac7d
authored
Sep 30, 2016
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd/openal: don't return zero sized packet if no samples are available
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
2face3e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
openal-dec.c
libavdevice/openal-dec.c
+10
-3
No files found.
libavdevice/openal-dec.c
View file @
fbf8ac7d
...
...
@@ -187,9 +187,16 @@ static int read_packet(AVFormatContext* ctx, AVPacket *pkt)
const
char
*
error_msg
;
ALCint
nb_samples
;
/* Get number of samples available */
alcGetIntegerv
(
ad
->
device
,
ALC_CAPTURE_SAMPLES
,
(
ALCsizei
)
sizeof
(
ALCint
),
&
nb_samples
);
if
(
error
=
al_get_error
(
ad
->
device
,
&
error_msg
))
goto
fail
;
for
(;;)
{
/* Get number of samples available */
alcGetIntegerv
(
ad
->
device
,
ALC_CAPTURE_SAMPLES
,
(
ALCsizei
)
sizeof
(
ALCint
),
&
nb_samples
);
if
(
error
=
al_get_error
(
ad
->
device
,
&
error_msg
))
goto
fail
;
if
(
nb_samples
>
0
)
break
;
if
(
ctx
->
flags
&
AVFMT_FLAG_NONBLOCK
)
return
AVERROR
(
EAGAIN
);
av_usleep
(
1000
);
}
/* Create a packet of appropriate size */
if
((
error
=
av_new_packet
(
pkt
,
nb_samples
*
ad
->
sample_step
))
<
0
)
...
...
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