Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
e6fb5a4f
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6fb5a4f
编写于
1月 22, 2011
作者:
P
Peter Ross
提交者:
Ronald S. Bultje
2月 03, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add ff_index_search_timestamp and ff_add_index_entry
Signed-off-by:
N
Ronald S. Bultje
<
rsbultje@gmail.com
>
上级
51b317d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
15 deletion
+45
-15
libavformat/internal.h
libavformat/internal.h
+14
-0
libavformat/utils.c
libavformat/utils.c
+30
-15
libavformat/wtv.c
libavformat/wtv.c
+1
-0
未找到文件。
libavformat/internal.h
浏览文件 @
e6fb5a4f
...
...
@@ -226,4 +226,18 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
*/
int
ff_find_stream_index
(
AVFormatContext
*
s
,
int
id
);
/**
* Internal version of av_index_search_timestamp
*/
int
ff_index_search_timestamp
(
const
AVIndexEntry
*
entries
,
int
nb_entries
,
int64_t
wanted_timestamp
,
int
flags
);
/**
* Internal version of av_add_index_entry
*/
int
ff_add_index_entry
(
AVIndexEntry
**
index_entries
,
int
*
nb_index_entries
,
unsigned
int
*
index_entries_allocated_size
,
int64_t
pos
,
int64_t
timestamp
,
int
size
,
int
distance
,
int
flags
);
#endif
/* AVFORMAT_INTERNAL_H */
libavformat/utils.c
浏览文件 @
e6fb5a4f
...
...
@@ -1370,28 +1370,30 @@ void ff_reduce_index(AVFormatContext *s, int stream_index)
}
}
int
av_add_index_entry
(
AVStream
*
st
,
int64_t
pos
,
int64_t
timestamp
,
int
size
,
int
distance
,
int
flags
)
int
ff_add_index_entry
(
AVIndexEntry
**
index_entries
,
int
*
nb_index_entries
,
unsigned
int
*
index_entries_allocated_size
,
int64_t
pos
,
int64_t
timestamp
,
int
size
,
int
distance
,
int
flags
)
{
AVIndexEntry
*
entries
,
*
ie
;
int
index
;
if
((
unsigned
)
st
->
nb_index_entries
+
1
>=
UINT_MAX
/
sizeof
(
AVIndexEntry
))
if
((
unsigned
)
*
nb_index_entries
+
1
>=
UINT_MAX
/
sizeof
(
AVIndexEntry
))
return
-
1
;
entries
=
av_fast_realloc
(
st
->
index_entries
,
&
st
->
index_entries_allocated_size
,
(
st
->
nb_index_entries
+
1
)
*
entries
=
av_fast_realloc
(
*
index_entries
,
index_entries_allocated_size
,
(
*
nb_index_entries
+
1
)
*
sizeof
(
AVIndexEntry
));
if
(
!
entries
)
return
-
1
;
st
->
index_entries
=
entries
;
*
index_entries
=
entries
;
index
=
av_index_search_timestamp
(
st
,
timestamp
,
AVSEEK_FLAG_ANY
);
index
=
ff_index_search_timestamp
(
*
index_entries
,
*
nb_index_entries
,
timestamp
,
AVSEEK_FLAG_ANY
);
if
(
index
<
0
){
index
=
st
->
nb_index_entries
++
;
index
=
(
*
nb_index_entries
)
++
;
ie
=
&
entries
[
index
];
assert
(
index
==
0
||
ie
[
-
1
].
timestamp
<
timestamp
);
}
else
{
...
...
@@ -1399,8 +1401,8 @@ int av_add_index_entry(AVStream *st,
if
(
ie
->
timestamp
!=
timestamp
){
if
(
ie
->
timestamp
<=
timestamp
)
return
-
1
;
memmove
(
entries
+
index
+
1
,
entries
+
index
,
sizeof
(
AVIndexEntry
)
*
(
st
->
nb_index_entries
-
index
));
st
->
nb_index_entries
++
;
memmove
(
entries
+
index
+
1
,
entries
+
index
,
sizeof
(
AVIndexEntry
)
*
(
*
nb_index_entries
-
index
));
(
*
nb_index_entries
)
++
;
}
else
if
(
ie
->
pos
==
pos
&&
distance
<
ie
->
min_distance
)
//do not reduce the distance
distance
=
ie
->
min_distance
;
}
...
...
@@ -1414,11 +1416,17 @@ int av_add_index_entry(AVStream *st,
return
index
;
}
int
av_index_search_timestamp
(
AVStream
*
st
,
int64_t
wanted_timestamp
,
int
flags
)
int
av_add_index_entry
(
AVStream
*
st
,
int64_t
pos
,
int64_t
timestamp
,
int
size
,
int
distance
,
int
flags
)
{
return
ff_add_index_entry
(
&
st
->
index_entries
,
&
st
->
nb_index_entries
,
&
st
->
index_entries_allocated_size
,
pos
,
timestamp
,
size
,
distance
,
flags
);
}
int
ff_index_search_timestamp
(
const
AVIndexEntry
*
entries
,
int
nb_entries
,
int64_t
wanted_timestamp
,
int
flags
)
{
AVIndexEntry
*
entries
=
st
->
index_entries
;
int
nb_entries
=
st
->
nb_index_entries
;
int
a
,
b
,
m
;
int64_t
timestamp
;
...
...
@@ -1450,6 +1458,13 @@ int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp,
return
m
;
}
int
av_index_search_timestamp
(
AVStream
*
st
,
int64_t
wanted_timestamp
,
int
flags
)
{
return
ff_index_search_timestamp
(
st
->
index_entries
,
st
->
nb_index_entries
,
wanted_timestamp
,
flags
);
}
#define DEBUG_SEEK
int
av_seek_frame_binary
(
AVFormatContext
*
s
,
int
stream_index
,
int64_t
target_ts
,
int
flags
){
...
...
libavformat/wtv.c
浏览文件 @
e6fb5a4f
...
...
@@ -28,6 +28,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat_readwrite.h"
#include "avformat.h"
#include "internal.h"
#include "riff.h"
#include "asf.h"
#include "mpegts.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录