Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
04e06cfa
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,发现更多精彩内容 >>
提交
04e06cfa
编写于
2月 08, 2009
作者:
B
Baptiste Coudurier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cosmetics: sample_to_chunk -> stsc
Originally committed as revision 17054 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
a234e38d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
libavformat/mov.c
libavformat/mov.c
+18
-18
未找到文件。
libavformat/mov.c
浏览文件 @
04e06cfa
...
...
@@ -113,8 +113,8 @@ typedef struct MOVStreamContext {
MOVStts
*
stts_data
;
unsigned
int
ctts_count
;
MOVStts
*
ctts_data
;
unsigned
int
s
ample_to_chunk_sz
;
MOVStsc
*
s
ample_to_chunk
;
unsigned
int
s
tsc_count
;
MOVStsc
*
s
tsc_data
;
int
ctts_index
;
int
ctts_sample
;
unsigned
int
sample_size
;
...
...
@@ -1067,19 +1067,19 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
entries
=
get_be32
(
pb
);
if
(
entries
>=
UINT_MAX
/
sizeof
(
*
sc
->
s
ample_to_chunk
))
if
(
entries
>=
UINT_MAX
/
sizeof
(
*
sc
->
s
tsc_data
))
return
-
1
;
dprintf
(
c
->
fc
,
"track[%i].stsc.entries = %i
\n
"
,
c
->
fc
->
nb_streams
-
1
,
entries
);
sc
->
s
ample_to_chunk_sz
=
entries
;
sc
->
s
ample_to_chunk
=
av_malloc
(
entries
*
sizeof
(
*
sc
->
sample_to_chunk
));
if
(
!
sc
->
s
ample_to_chunk
)
sc
->
s
tsc_count
=
entries
;
sc
->
s
tsc_data
=
av_malloc
(
entries
*
sizeof
(
*
sc
->
stsc_data
));
if
(
!
sc
->
s
tsc_data
)
return
-
1
;
for
(
i
=
0
;
i
<
entries
;
i
++
)
{
sc
->
s
ample_to_chunk
[
i
].
first
=
get_be32
(
pb
);
sc
->
s
ample_to_chunk
[
i
].
count
=
get_be32
(
pb
);
sc
->
s
ample_to_chunk
[
i
].
id
=
get_be32
(
pb
);
sc
->
s
tsc_data
[
i
].
first
=
get_be32
(
pb
);
sc
->
s
tsc_data
[
i
].
count
=
get_be32
(
pb
);
sc
->
s
tsc_data
[
i
].
id
=
get_be32
(
pb
);
}
return
0
;
}
...
...
@@ -1249,10 +1249,10 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
st
->
nb_frames
=
sc
->
sample_count
;
for
(
i
=
0
;
i
<
sc
->
chunk_count
;
i
++
)
{
current_offset
=
sc
->
chunk_offsets
[
i
];
if
(
stsc_index
+
1
<
sc
->
s
ample_to_chunk_sz
&&
i
+
1
==
sc
->
s
ample_to_chunk
[
stsc_index
+
1
].
first
)
if
(
stsc_index
+
1
<
sc
->
s
tsc_count
&&
i
+
1
==
sc
->
s
tsc_data
[
stsc_index
+
1
].
first
)
stsc_index
++
;
for
(
j
=
0
;
j
<
sc
->
s
ample_to_chunk
[
stsc_index
].
count
;
j
++
)
{
for
(
j
=
0
;
j
<
sc
->
s
tsc_data
[
stsc_index
].
count
;
j
++
)
{
if
(
current_sample
>=
sc
->
sample_count
)
{
av_log
(
mov
->
fc
,
AV_LOG_ERROR
,
"wrong sample count
\n
"
);
goto
out
;
...
...
@@ -1265,7 +1265,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
sample_size
=
sc
->
sample_size
>
0
?
sc
->
sample_size
:
sc
->
sample_sizes
[
current_sample
];
if
(
sc
->
pseudo_stream_id
==
-
1
||
sc
->
s
ample_to_chunk
[
stsc_index
].
id
-
1
==
sc
->
pseudo_stream_id
)
{
sc
->
s
tsc_data
[
stsc_index
].
id
-
1
==
sc
->
pseudo_stream_id
)
{
av_add_index_entry
(
st
,
current_offset
,
current_dts
,
sample_size
,
distance
,
keyframe
?
AVINDEX_KEYFRAME
:
0
);
dprintf
(
mov
->
fc
,
"AVIndex stream %d, sample %d, offset %"
PRIx64
", dts %"
PRId64
", "
...
...
@@ -1289,10 +1289,10 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
unsigned
int
frames
=
1
;
for
(
i
=
0
;
i
<
sc
->
chunk_count
;
i
++
)
{
current_offset
=
sc
->
chunk_offsets
[
i
];
if
(
stsc_index
+
1
<
sc
->
s
ample_to_chunk_sz
&&
i
+
1
==
sc
->
s
ample_to_chunk
[
stsc_index
+
1
].
first
)
if
(
stsc_index
+
1
<
sc
->
s
tsc_count
&&
i
+
1
==
sc
->
s
tsc_data
[
stsc_index
+
1
].
first
)
stsc_index
++
;
chunk_samples
=
sc
->
s
ample_to_chunk
[
stsc_index
].
count
;
chunk_samples
=
sc
->
s
tsc_data
[
stsc_index
].
count
;
/* get chunk size, beware of alaw/ulaw/mace */
if
(
sc
->
samples_per_frame
>
0
&&
(
chunk_samples
*
sc
->
bytes_per_frame
%
sc
->
samples_per_frame
==
0
))
{
...
...
@@ -1355,7 +1355,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
return
ret
;
/* sanity checks */
if
(
sc
->
chunk_count
&&
(
!
sc
->
stts_count
||
!
sc
->
s
ample_to_chunk_sz
||
if
(
sc
->
chunk_count
&&
(
!
sc
->
stts_count
||
!
sc
->
s
tsc_count
||
(
!
sc
->
sample_size
&&
!
sc
->
sample_count
))){
av_log
(
c
->
fc
,
AV_LOG_ERROR
,
"stream %d, missing mandatory atoms, broken header
\n
"
,
st
->
index
);
...
...
@@ -1403,7 +1403,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
/* Do not need those anymore. */
av_freep
(
&
sc
->
chunk_offsets
);
av_freep
(
&
sc
->
s
ample_to_chunk
);
av_freep
(
&
sc
->
s
tsc_data
);
av_freep
(
&
sc
->
sample_sizes
);
av_freep
(
&
sc
->
keyframes
);
av_freep
(
&
sc
->
stts_data
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录