Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
7a4fbf83
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,发现更多精彩内容 >>
提交
7a4fbf83
编写于
11月 17, 2015
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ijkavformat/ijkurlhook: always return error until recoverd from error state
上级
3ec734c3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
3 deletion
+20
-3
ijkmedia/ijkplayer/ijkavformat/ijkurlhook.c
ijkmedia/ijkplayer/ijkavformat/ijkurlhook.c
+20
-3
未找到文件。
ijkmedia/ijkplayer/ijkavformat/ijkurlhook.c
浏览文件 @
7a4fbf83
...
...
@@ -34,6 +34,7 @@ typedef struct Context {
int64_t
logical_pos
;
int64_t
logical_size
;
int
io_error
;
IJKAVInject_OnUrlOpenData
inject_data
;
const
char
*
scheme
;
...
...
@@ -116,7 +117,8 @@ static int ijkurlhook_reconnect(URLContext *h, AVDictionary *extra)
c
->
logical_size
=
-
1
;
else
c
->
logical_size
=
ffurl_seek
(
c
->
inner
,
0
,
AVSEEK_SIZE
);
c
->
io_error
=
0
;
fail:
av_dict_free
(
&
inner_options
);
return
ret
;
...
...
@@ -186,14 +188,20 @@ static int ijkurlhook_read(URLContext *h, unsigned char *buf, int size)
Context
*
c
=
h
->
priv_data
;
int
ret
=
0
;
if
(
c
->
io_error
<
0
)
return
c
->
io_error
;
if
(
c
->
test_fail_point_next
>
0
&&
c
->
logical_pos
>=
c
->
test_fail_point_next
)
{
av_log
(
h
,
AV_LOG_ERROR
,
"test fail point:%"
PRId64
"
\n
"
,
c
->
test_fail_point_next
);
c
->
io_error
=
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
}
ret
=
ffurl_read
(
c
->
inner
,
buf
,
size
);
if
(
ret
>
0
)
c
->
logical_pos
+=
ret
;
else
c
->
io_error
=
ret
;
return
ret
;
}
...
...
@@ -211,12 +219,16 @@ static int64_t ijkurlhook_seek(URLContext *h, int64_t pos, int whence)
int64_t
seek_ret
=
0
;
seek_ret
=
ffurl_seek
(
c
->
inner
,
pos
,
whence
);
if
(
seek_ret
<
0
)
if
(
seek_ret
<
0
)
{
c
->
io_error
=
seek_ret
;
return
seek_ret
;
}
c
->
logical_pos
=
seek_ret
;
if
(
c
->
test_fail_point
)
c
->
test_fail_point_next
=
c
->
logical_pos
+
c
->
test_fail_point
;
c
->
io_error
=
0
;
return
seek_ret
;
}
...
...
@@ -285,6 +297,7 @@ static int ijkhttphook_read(URLContext *h, unsigned char *buf, int size)
read_ret
=
ijkurlhook_read
(
h
,
buf
,
size
);
while
(
read_ret
<
0
&&
!
h
->
is_streamed
&&
c
->
logical_pos
<
c
->
logical_size
)
{
c
->
io_error
=
read_ret
;
switch
(
read_ret
)
{
case
AVERROR_EXIT
:
goto
fail
;
...
...
@@ -331,9 +344,12 @@ static int64_t ijkhttphook_reseek_at(URLContext *h, int64_t pos, int whence, int
return
AVERROR
(
EINVAL
);
ret
=
ijkhttphook_reconnect_at
(
h
,
pos
);
if
(
ret
)
if
(
ret
)
{
c
->
io_error
=
ret
;
return
ret
;
}
c
->
io_error
=
0
;
return
c
->
logical_pos
;
}
...
...
@@ -383,6 +399,7 @@ static int64_t ijkhttphook_seek(URLContext *h, int64_t pos, int whence)
if
(
c
->
test_fail_point
)
c
->
test_fail_point_next
=
c
->
logical_pos
+
c
->
test_fail_point
;
c
->
io_error
=
0
;
return
c
->
logical_pos
;
fail:
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录