Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
a82531dc
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,发现更多精彩内容 >>
提交
a82531dc
编写于
3月 17, 2017
作者:
R
raymondzheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ijkplayer: ijkio fix ijkio file issue
上级
83080edc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
12 deletion
+18
-12
ijkmedia/ijkplayer/ijkavformat/ijkioapplication.h
ijkmedia/ijkplayer/ijkavformat/ijkioapplication.h
+1
-0
ijkmedia/ijkplayer/ijkavformat/ijkiocache.c
ijkmedia/ijkplayer/ijkavformat/ijkiocache.c
+12
-12
ijkmedia/ijkplayer/ijkavformat/ijkiomanager.c
ijkmedia/ijkplayer/ijkavformat/ijkiomanager.c
+5
-0
未找到文件。
ijkmedia/ijkplayer/ijkavformat/ijkioapplication.h
浏览文件 @
a82531dc
...
...
@@ -47,6 +47,7 @@ struct IjkIOApplicationContext {
void
*
cache_info_map
;
void
*
opaque
;
int64_t
cache_count_bytes
;
int
fd
;
int
(
*
func_ijkio_on_app_event
)(
IjkIOApplicationContext
*
h
,
int
event_type
,
void
*
obj
,
int
size
);
};
...
...
ijkmedia/ijkplayer/ijkavformat/ijkiocache.c
浏览文件 @
a82531dc
...
...
@@ -168,15 +168,15 @@ static int ijkio_cache_file_error(IjkURLContext *h) {
c
->
file_logical_pos
=
c
->
fifo_logical_pos
;
close
(
c
->
fd
);
c
->
fd
=
-
1
;
c
->
ijkio_app_ctx
->
fd
=
-
1
;
if
(
c
->
file_error_count
>
3
)
{
c
->
fifo_pos_reset
=
1
;
c
->
cache_file_close
=
1
;
close
(
c
->
fd
);
remove
(
c
->
cache_file_path
);
c
->
fd
=
-
1
;
return
0
;
}
c
->
fd
=
open
(
c
->
cache_file_path
,
O_RDWR
|
O_BINARY
|
O_CREAT
|
O_TRUNC
,
0600
);
c
->
ijkio_app_ctx
->
fd
=
c
->
fd
;
if
(
c
->
fd
>=
0
)
{
c
->
file_handle_retry_count
=
0
;
c
->
tree_info
=
calloc
(
1
,
sizeof
(
IjkCacheTreeInfo
));
...
...
@@ -691,7 +691,12 @@ static int ijkio_cache_open(IjkURLContext *h, const char *url, int flags, IjkAVD
if
(
!
c
->
cache_file_close
)
{
do
{
c
->
fd
=
open
(
c
->
cache_file_path
,
O_RDWR
|
O_BINARY
|
O_CREAT
,
0600
);
if
(
c
->
ijkio_app_ctx
->
fd
>=
0
)
{
c
->
fd
=
c
->
ijkio_app_ctx
->
fd
;
}
else
{
c
->
fd
=
open
(
c
->
cache_file_path
,
O_RDWR
|
O_BINARY
|
O_CREAT
,
0600
);
c
->
ijkio_app_ctx
->
fd
=
c
->
fd
;
}
if
(
c
->
fd
<
0
)
{
c
->
cache_file_close
=
1
;
break
;
...
...
@@ -701,6 +706,8 @@ static int ijkio_cache_open(IjkURLContext *h, const char *url, int flags, IjkAVD
if
(
seek_ret
<
0
)
{
c
->
cache_file_close
=
1
;
close
(
c
->
fd
);
c
->
fd
=
-
1
;
c
->
ijkio_app_ctx
->
fd
=
-
1
;
break
;
}
else
{
c
->
cache_physical_pos
=
*
c
->
last_physical_pos
;
...
...
@@ -890,8 +897,6 @@ static int ijkio_cache_close(IjkURLContext *h) {
pthread_cond_destroy
(
&
c
->
cond_wakeup_exit
);
pthread_mutex_destroy
(
&
c
->
mutex
);
close
(
c
->
fd
);
ret
=
c
->
inner
->
prot
->
url_close
(
c
->
inner
);
ijk_av_fifo_freep
(
&
c
->
fifo
);
...
...
@@ -913,8 +918,6 @@ static int ijkio_cache_pause(IjkURLContext *h) {
if
(
c
->
task_is_running
)
{
pthread_cond_wait
(
&
c
->
cond_wakeup_exit
,
&
c
->
mutex
);
}
close
(
c
->
fd
);
c
->
fd
=
-
1
;
pthread_mutex_unlock
(
&
c
->
mutex
);
if
(
c
->
inner
->
prot
->
url_pause
)
{
...
...
@@ -933,15 +936,12 @@ static int ijkio_cache_resume(IjkURLContext *h) {
if
(
c
->
cache_file_path
==
NULL
||
0
==
strlen
(
c
->
cache_file_path
))
{
c
->
cache_file_close
=
1
;
}
else
{
c
->
fd
=
open
(
c
->
cache_file_path
,
O_RDWR
|
O_BINARY
|
O_CREAT
,
0600
);
if
(
c
->
fd
<
0
)
{
c
->
cache_file_close
=
1
;
}
int64_t
seek_ret
=
lseek
(
c
->
fd
,
*
c
->
last_physical_pos
,
SEEK_SET
);
if
(
seek_ret
<
0
)
{
c
->
cache_file_close
=
1
;
close
(
c
->
fd
);
c
->
fd
=
-
1
;
c
->
ijkio_app_ctx
->
fd
=
-
1
;
}
else
{
c
->
cache_physical_pos
=
*
c
->
last_physical_pos
;
}
...
...
ijkmedia/ijkplayer/ijkavformat/ijkiomanager.c
浏览文件 @
a82531dc
...
...
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
static
int
ijkio_manager_alloc
(
IjkIOManagerContext
**
ph
,
void
*
opaque
)
{
...
...
@@ -44,6 +45,7 @@ static int ijkio_manager_alloc(IjkIOManagerContext **ph, void *opaque)
h
->
ijkio_app_ctx
->
threadpool_ctx
=
ijk_threadpool_create
(
5
,
5
,
0
);
h
->
ijkio_app_ctx
->
cache_info_map
=
ijk_map_create
();
h
->
ijkio_app_ctx
->
fd
=
-
1
;
*
ph
=
h
;
return
0
;
}
...
...
@@ -80,6 +82,9 @@ void ijkio_manager_destroy(IjkIOManagerContext *h)
}
if
(
0
!=
strlen
(
h
->
ijkio_app_ctx
->
cache_file_path
))
{
if
(
h
->
ijkio_app_ctx
->
fd
>=
0
)
{
close
(
h
->
ijkio_app_ctx
->
fd
);
}
remove
(
h
->
ijkio_app_ctx
->
cache_file_path
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录