Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
62cea6b5
I
ijkplayer
项目概览
qq_25606643
/
ijkplayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
ijkplayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
62cea6b5
编写于
7月 02, 2013
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ffplay: reuse toggle_pause and toggle_stream_pause
上级
80d14d8a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
26 deletion
+23
-26
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
+23
-26
未找到文件。
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
浏览文件 @
62cea6b5
...
@@ -365,26 +365,39 @@ static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_by
...
@@ -365,26 +365,39 @@ static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_by
}
}
/* pause or resume the video */
/* pause or resume the video */
static
void
stream_toggle_pause
(
VideoState
*
is
)
static
void
stream_toggle_pause
(
FFPlayer
*
ffp
,
int
pause_on
)
{
{
if
(
is
->
paused
)
{
VideoState
*
is
=
ffp
->
is
;
ffp
->
start_on_prepared
=
!
pause_on
;
if
(
!
pause_on
&&
is
->
paused
)
{
is
->
frame_timer
+=
av_gettime
()
/
1000000
.
0
+
is
->
video_current_pts_drift
-
is
->
video_current_pts
;
is
->
frame_timer
+=
av_gettime
()
/
1000000
.
0
+
is
->
video_current_pts_drift
-
is
->
video_current_pts
;
if
(
is
->
read_pause_return
!=
AVERROR
(
ENOSYS
))
{
if
(
is
->
read_pause_return
!=
AVERROR
(
ENOSYS
))
{
is
->
video_current_pts
=
is
->
video_current_pts_drift
+
av_gettime
()
/
1000000
.
0
;
is
->
video_current_pts
=
is
->
video_current_pts_drift
+
av_gettime
()
/
1000000
.
0
;
}
}
is
->
video_current_pts_drift
=
is
->
video_current_pts
-
av_gettime
()
/
1000000
.
0
;
is
->
video_current_pts_drift
=
is
->
video_current_pts
-
av_gettime
()
/
1000000
.
0
;
}
}
update_external_clock_pts
(
is
,
get_external_clock
(
is
));
update_external_clock_pts
(
is
,
get_external_clock
(
is
));
is
->
paused
=
!
is
->
paused
;
is
->
paused
=
pause_on
;
SDL_AoutPauseAudio
(
ffp
->
aout
,
pause_on
);
}
}
// FFP_MERGE: toggle_pause
static
void
toggle_pause
(
FFPlayer
*
ffp
,
int
pause_on
)
{
VideoState
*
is
=
ffp
->
is
;
stream_toggle_pause
(
ffp
,
pause_on
);
is
->
step
=
0
;
}
static
void
step_to_next_frame
(
VideoState
*
is
)
static
void
step_to_next_frame
(
FFPlayer
*
ffp
)
{
{
VideoState
*
is
=
ffp
->
is
;
/* if the stream is paused unpause it, then step */
/* if the stream is paused unpause it, then step */
if
(
is
->
paused
)
if
(
is
->
paused
)
stream_toggle_pause
(
is
);
stream_toggle_pause
(
ffp
,
0
);
is
->
step
=
1
;
is
->
step
=
1
;
}
}
...
@@ -552,7 +565,7 @@ display:
...
@@ -552,7 +565,7 @@ display:
pictq_next_picture
(
is
);
pictq_next_picture
(
is
);
if
(
is
->
step
&&
!
is
->
paused
)
if
(
is
->
step
&&
!
is
->
paused
)
stream_toggle_pause
(
is
);
stream_toggle_pause
(
ffp
,
1
);
}
}
}
}
is
->
force_refresh
=
0
;
is
->
force_refresh
=
0
;
...
@@ -1741,7 +1754,7 @@ static int read_thread(void *arg)
...
@@ -1741,7 +1754,7 @@ static int read_thread(void *arg)
if
(
ffp
->
start_on_prepared
)
if
(
ffp
->
start_on_prepared
)
ffp_notify_msg
(
ffp
,
FFP_REQ_START
,
0
,
0
);
ffp_notify_msg
(
ffp
,
FFP_REQ_START
,
0
,
0
);
if
(
is
->
paused
)
if
(
is
->
paused
)
step_to_next_frame
(
is
);
step_to_next_frame
(
ffp
);
}
}
if
(
is
->
queue_attachments_req
)
{
if
(
is
->
queue_attachments_req
)
{
avformat_queue_attached_pictures
(
ic
);
avformat_queue_attached_pictures
(
ic
);
...
@@ -2109,20 +2122,7 @@ int ffp_start_l(FFPlayer *ffp)
...
@@ -2109,20 +2122,7 @@ int ffp_start_l(FFPlayer *ffp)
if
(
!
is
)
if
(
!
is
)
return
EIJK_NULL_IS_PTR
;
return
EIJK_NULL_IS_PTR
;
ffp
->
start_on_prepared
=
true
;
toggle_pause
(
ffp
,
0
);
if
(
ffp
->
prepared
)
{
if
(
is
->
paused
)
{
is
->
frame_timer
+=
av_gettime
()
/
1000000
.
0
+
is
->
video_current_pts_drift
-
is
->
video_current_pts
;
if
(
is
->
read_pause_return
!=
AVERROR
(
ENOSYS
))
{
is
->
video_current_pts
=
is
->
video_current_pts_drift
+
av_gettime
()
/
1000000
.
0
;
}
is
->
video_current_pts_drift
=
is
->
video_current_pts
-
av_gettime
()
/
1000000
.
0
;
}
update_external_clock_pts
(
is
,
get_external_clock
(
is
));
is
->
paused
=
0
;
SDL_AoutPauseAudio
(
ffp
->
aout
,
is
->
paused
);
}
return
0
;
return
0
;
}
}
...
@@ -2133,10 +2133,7 @@ int ffp_pause_l(FFPlayer *ffp)
...
@@ -2133,10 +2133,7 @@ int ffp_pause_l(FFPlayer *ffp)
if
(
!
is
)
if
(
!
is
)
return
EIJK_NULL_IS_PTR
;
return
EIJK_NULL_IS_PTR
;
update_external_clock_pts
(
is
,
get_external_clock
(
is
));
toggle_pause
(
ffp
,
1
);
is
->
paused
=
1
;
SDL_AoutPauseAudio
(
ffp
->
aout
,
is
->
paused
);
ffp
->
start_on_prepared
=
false
;
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录