Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
0166d329
Commit
0166d329
authored
Aug 08, 2015
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffplay: add specific constants for buffer fullness settings when using external clock
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
7fbafd0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
ffplay.c
ffplay.c
+6
-4
No files found.
ffplay.c
View file @
0166d329
...
@@ -67,6 +67,8 @@ const int program_birth_year = 2003;
...
@@ -67,6 +67,8 @@ const int program_birth_year = 2003;
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
#define MIN_FRAMES 5
#define MIN_FRAMES 5
#define EXTERNAL_CLOCK_MIN_FRAMES 2
#define EXTERNAL_CLOCK_MAX_FRAMES 10
/* Minimum SDL audio buffer size, in samples. */
/* Minimum SDL audio buffer size, in samples. */
#define SDL_AUDIO_MIN_BUFFER_SIZE 512
#define SDL_AUDIO_MIN_BUFFER_SIZE 512
...
@@ -1301,11 +1303,11 @@ static double get_master_clock(VideoState *is)
...
@@ -1301,11 +1303,11 @@ static double get_master_clock(VideoState *is)
}
}
static
void
check_external_clock_speed
(
VideoState
*
is
)
{
static
void
check_external_clock_speed
(
VideoState
*
is
)
{
if
(
is
->
video_stream
>=
0
&&
is
->
videoq
.
nb_packets
<=
MIN_FRAMES
/
2
||
if
(
is
->
video_stream
>=
0
&&
is
->
videoq
.
nb_packets
<=
EXTERNAL_CLOCK_MIN_FRAMES
||
is
->
audio_stream
>=
0
&&
is
->
audioq
.
nb_packets
<=
MIN_FRAMES
/
2
)
{
is
->
audio_stream
>=
0
&&
is
->
audioq
.
nb_packets
<=
EXTERNAL_CLOCK_MIN_FRAMES
)
{
set_clock_speed
(
&
is
->
extclk
,
FFMAX
(
EXTERNAL_CLOCK_SPEED_MIN
,
is
->
extclk
.
speed
-
EXTERNAL_CLOCK_SPEED_STEP
));
set_clock_speed
(
&
is
->
extclk
,
FFMAX
(
EXTERNAL_CLOCK_SPEED_MIN
,
is
->
extclk
.
speed
-
EXTERNAL_CLOCK_SPEED_STEP
));
}
else
if
((
is
->
video_stream
<
0
||
is
->
videoq
.
nb_packets
>
MIN_FRAMES
*
2
)
&&
}
else
if
((
is
->
video_stream
<
0
||
is
->
videoq
.
nb_packets
>
EXTERNAL_CLOCK_MAX_FRAMES
)
&&
(
is
->
audio_stream
<
0
||
is
->
audioq
.
nb_packets
>
MIN_FRAMES
*
2
))
{
(
is
->
audio_stream
<
0
||
is
->
audioq
.
nb_packets
>
EXTERNAL_CLOCK_MAX_FRAMES
))
{
set_clock_speed
(
&
is
->
extclk
,
FFMIN
(
EXTERNAL_CLOCK_SPEED_MAX
,
is
->
extclk
.
speed
+
EXTERNAL_CLOCK_SPEED_STEP
));
set_clock_speed
(
&
is
->
extclk
,
FFMIN
(
EXTERNAL_CLOCK_SPEED_MAX
,
is
->
extclk
.
speed
+
EXTERNAL_CLOCK_SPEED_STEP
));
}
else
{
}
else
{
double
speed
=
is
->
extclk
.
speed
;
double
speed
=
is
->
extclk
.
speed
;
...
...
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