Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
ee71ef5c
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,发现更多精彩内容 >>
提交
ee71ef5c
编写于
10月 17, 2006
作者:
B
Baptiste Coudurier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skip run in sequence, fix C0023S01.mxf
Originally committed as revision 6720 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
cc6a90dd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
15 deletion
+25
-15
libavformat/mxf.c
libavformat/mxf.c
+25
-15
未找到文件。
libavformat/mxf.c
浏览文件 @
ee71ef5c
...
...
@@ -943,11 +943,29 @@ static const MXFMetadataReadTableEntry mxf_metadata_read_table[] = {
{
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
},
NULL
},
};
static
int
mxf_read_sync
(
ByteIOContext
*
pb
,
const
uint8_t
*
key
,
unsigned
size
)
{
int
i
,
b
;
for
(
i
=
0
;
i
<
size
&&
!
url_feof
(
pb
);
i
++
)
{
b
=
get_byte
(
pb
);
if
(
b
==
key
[
0
])
i
=
0
;
else
if
(
b
!=
key
[
i
])
i
=
-
1
;
}
return
i
==
size
;
}
static
int
mxf_read_header
(
AVFormatContext
*
s
,
AVFormatParameters
*
ap
)
{
MXFContext
*
mxf
=
s
->
priv_data
;
KLVPacket
klv
;
if
(
!
mxf_read_sync
(
&
s
->
pb
,
mxf_header_partition_pack_key
,
14
))
{
av_log
(
s
,
AV_LOG_ERROR
,
"could not find header partition pack key
\n
"
);
return
-
1
;
}
url_fseek
(
&
s
->
pb
,
-
14
,
SEEK_CUR
);
mxf
->
fc
=
s
;
while
(
!
url_feof
(
&
s
->
pb
))
{
const
MXFMetadataReadTableEntry
*
function
;
...
...
@@ -1031,7 +1049,6 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
{
AVStream
*
st
=
s
->
streams
[
stream_index
];
int64_t
seconds
;
int
i
;
if
(
!
s
->
bit_rate
)
return
-
1
;
...
...
@@ -1039,20 +1056,13 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
sample_time
=
0
;
seconds
=
av_rescale
(
sample_time
,
st
->
time_base
.
num
,
st
->
time_base
.
den
);
url_fseek
(
&
s
->
pb
,
(
s
->
bit_rate
*
seconds
)
>>
3
,
SEEK_SET
);
/* sync on KLV essence element */
for
(
i
=
0
;
i
<
12
&&
url_ftell
(
&
s
->
pb
)
<
s
->
file_size
;
i
++
)
{
int
b
=
get_byte
(
&
s
->
pb
);
if
(
b
==
mxf_essence_element_key
[
0
])
i
=
0
;
else
if
(
b
!=
mxf_essence_element_key
[
i
])
i
=
-
1
;
}
if
(
i
==
12
)
{
/* found KLV key */
url_fseek
(
&
s
->
pb
,
-
12
,
SEEK_CUR
);
av_update_cur_dts
(
s
,
st
,
sample_time
);
return
0
;
}
return
-
1
;
if
(
!
mxf_read_sync
(
&
s
->
pb
,
mxf_essence_element_key
,
12
))
return
-
1
;
/* found KLV key */
url_fseek
(
&
s
->
pb
,
-
12
,
SEEK_CUR
);
av_update_cur_dts
(
s
,
st
,
sample_time
);
return
0
;
}
AVInputFormat
mxf_demuxer
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录