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
e2a2c49f
Commit
e2a2c49f
authored
Oct 11, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avplay: use a separate buffer for playing silence
parent
f08e54e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
avplay.c
avplay.c
+3
-3
No files found.
avplay.c
View file @
e2a2c49f
...
@@ -157,6 +157,7 @@ typedef struct VideoState {
...
@@ -157,6 +157,7 @@ typedef struct VideoState {
compensation */
compensation */
DECLARE_ALIGNED
(
16
,
uint8_t
,
audio_buf1
)[(
AVCODEC_MAX_AUDIO_FRAME_SIZE
*
3
)
/
2
];
DECLARE_ALIGNED
(
16
,
uint8_t
,
audio_buf1
)[(
AVCODEC_MAX_AUDIO_FRAME_SIZE
*
3
)
/
2
];
DECLARE_ALIGNED
(
16
,
uint8_t
,
audio_buf2
)[(
AVCODEC_MAX_AUDIO_FRAME_SIZE
*
3
)
/
2
];
DECLARE_ALIGNED
(
16
,
uint8_t
,
audio_buf2
)[(
AVCODEC_MAX_AUDIO_FRAME_SIZE
*
3
)
/
2
];
uint8_t
silence_buf
[
SDL_AUDIO_BUFFER_SIZE
];
uint8_t
*
audio_buf
;
uint8_t
*
audio_buf
;
unsigned
int
audio_buf_size
;
/* in bytes */
unsigned
int
audio_buf_size
;
/* in bytes */
int
audio_buf_index
;
/* in bytes */
int
audio_buf_index
;
/* in bytes */
...
@@ -2129,9 +2130,8 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
...
@@ -2129,9 +2130,8 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
audio_size
=
audio_decode_frame
(
is
,
&
pts
);
audio_size
=
audio_decode_frame
(
is
,
&
pts
);
if
(
audio_size
<
0
)
{
if
(
audio_size
<
0
)
{
/* if error, just output silence */
/* if error, just output silence */
is
->
audio_buf
=
is
->
audio_buf1
;
is
->
audio_buf
=
is
->
silence_buf
;
is
->
audio_buf_size
=
1024
;
is
->
audio_buf_size
=
sizeof
(
is
->
silence_buf
);
memset
(
is
->
audio_buf
,
0
,
is
->
audio_buf_size
);
}
else
{
}
else
{
if
(
is
->
show_audio
)
if
(
is
->
show_audio
)
update_sample_display
(
is
,
(
int16_t
*
)
is
->
audio_buf
,
audio_size
);
update_sample_display
(
is
,
(
int16_t
*
)
is
->
audio_buf
,
audio_size
);
...
...
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