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
8594a8fb
Commit
8594a8fb
authored
Jun 11, 2016
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffplay: factorize checking if a stream needs additional packets
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
cc16229d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
ffplay.c
ffplay.c
+10
-4
No files found.
ffplay.c
View file @
8594a8fb
...
...
@@ -2796,6 +2796,13 @@ static int decode_interrupt_cb(void *ctx)
return
is
->
abort_request
;
}
static
int
stream_has_enough_packets
(
AVStream
*
st
,
int
stream_id
,
PacketQueue
*
queue
)
{
return
stream_id
<
0
||
queue
->
abort_request
||
(
st
->
disposition
&
AV_DISPOSITION_ATTACHED_PIC
)
||
queue
->
nb_packets
>
MIN_FRAMES
;
}
static
int
is_realtime
(
AVFormatContext
*
s
)
{
if
(
!
strcmp
(
s
->
iformat
->
name
,
"rtp"
)
...
...
@@ -3060,10 +3067,9 @@ static int read_thread(void *arg)
/* if the queue are full, no need to read more */
if
(
infinite_buffer
<
1
&&
(
is
->
audioq
.
size
+
is
->
videoq
.
size
+
is
->
subtitleq
.
size
>
MAX_QUEUE_SIZE
||
(
(
is
->
audioq
.
nb_packets
>
MIN_FRAMES
||
is
->
audio_stream
<
0
||
is
->
audioq
.
abort_request
)
&&
(
is
->
videoq
.
nb_packets
>
MIN_FRAMES
||
is
->
video_stream
<
0
||
is
->
videoq
.
abort_request
||
(
is
->
video_st
->
disposition
&
AV_DISPOSITION_ATTACHED_PIC
))
&&
(
is
->
subtitleq
.
nb_packets
>
MIN_FRAMES
||
is
->
subtitle_stream
<
0
||
is
->
subtitleq
.
abort_request
))))
{
||
(
stream_has_enough_packets
(
is
->
audio_st
,
is
->
audio_stream
,
&
is
->
audioq
)
&&
stream_has_enough_packets
(
is
->
video_st
,
is
->
video_stream
,
&
is
->
videoq
)
&&
stream_has_enough_packets
(
is
->
subtitle_st
,
is
->
subtitle_stream
,
&
is
->
subtitleq
))))
{
/* wait 10 ms */
SDL_LockMutex
(
wait_mutex
);
SDL_CondWaitTimeout
(
is
->
continue_read_thread
,
wait_mutex
,
10
);
...
...
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