Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
ba8a76b8
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,发现更多精彩内容 >>
提交
ba8a76b8
编写于
10月 21, 2007
作者:
A
Aurelien Jacobs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cosmetics: reindent
Originally committed as revision 10830 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
f9cdbfa2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
62 addition
and
62 deletion
+62
-62
libavformat/matroskadec.c
libavformat/matroskadec.c
+62
-62
未找到文件。
libavformat/matroskadec.c
浏览文件 @
ba8a76b8
...
...
@@ -2379,74 +2379,74 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
timecode
=
cluster_time
+
block_time
;
for
(
n
=
0
;
n
<
laces
;
n
++
)
{
if
(
st
->
codec
->
codec_id
==
CODEC_ID_RA_288
||
st
->
codec
->
codec_id
==
CODEC_ID_COOK
||
st
->
codec
->
codec_id
==
CODEC_ID_ATRAC3
)
{
MatroskaAudioTrack
*
audiotrack
=
(
MatroskaAudioTrack
*
)
matroska
->
tracks
[
track
];
int
a
=
st
->
codec
->
block_align
;
int
sps
=
audiotrack
->
sub_packet_size
;
int
cfs
=
audiotrack
->
coded_framesize
;
int
h
=
audiotrack
->
sub_packet_h
;
int
y
=
audiotrack
->
sub_packet_cnt
;
int
w
=
audiotrack
->
frame_size
;
int
x
;
if
(
!
audiotrack
->
pkt_cnt
)
{
if
(
st
->
codec
->
codec_id
==
CODEC_ID_RA_288
)
for
(
x
=
0
;
x
<
h
/
2
;
x
++
)
memcpy
(
audiotrack
->
buf
+
x
*
2
*
w
+
y
*
cfs
,
data
+
x
*
cfs
,
cfs
);
else
for
(
x
=
0
;
x
<
w
/
sps
;
x
++
)
memcpy
(
audiotrack
->
buf
+
sps
*
(
h
*
x
+
((
h
+
1
)
/
2
)
*
(
y
&
1
)
+
(
y
>>
1
)),
data
+
x
*
sps
,
sps
);
if
(
++
audiotrack
->
sub_packet_cnt
>=
h
)
{
audiotrack
->
sub_packet_cnt
=
0
;
audiotrack
->
pkt_cnt
=
h
*
w
/
a
;
}
}
while
(
audiotrack
->
pkt_cnt
)
{
pkt
=
av_mallocz
(
sizeof
(
AVPacket
));
av_new_packet
(
pkt
,
a
);
memcpy
(
pkt
->
data
,
audiotrack
->
buf
+
a
*
(
h
*
w
/
a
-
audiotrack
->
pkt_cnt
--
),
a
);
pkt
->
pos
=
pos
;
pkt
->
stream_index
=
matroska
->
tracks
[
track
]
->
stream_index
;
matroska_queue_packet
(
matroska
,
pkt
);
}
}
else
{
int
offset
=
0
;
if
(
st
->
codec
->
codec_id
==
CODEC_ID_TEXT
&&
((
MatroskaSubtitleTrack
*
)(
matroska
->
tracks
[
track
]))
->
ass
)
{
int
i
;
for
(
i
=
0
;
i
<
8
&&
data
[
offset
];
offset
++
)
if
(
data
[
offset
]
==
','
)
i
++
;
if
(
st
->
codec
->
codec_id
==
CODEC_ID_RA_288
||
st
->
codec
->
codec_id
==
CODEC_ID_COOK
||
st
->
codec
->
codec_id
==
CODEC_ID_ATRAC3
)
{
MatroskaAudioTrack
*
audiotrack
=
(
MatroskaAudioTrack
*
)
matroska
->
tracks
[
track
];
int
a
=
st
->
codec
->
block_align
;
int
sps
=
audiotrack
->
sub_packet_size
;
int
cfs
=
audiotrack
->
coded_framesize
;
int
h
=
audiotrack
->
sub_packet_h
;
int
y
=
audiotrack
->
sub_packet_cnt
;
int
w
=
audiotrack
->
frame_size
;
int
x
;
if
(
!
audiotrack
->
pkt_cnt
)
{
if
(
st
->
codec
->
codec_id
==
CODEC_ID_RA_288
)
for
(
x
=
0
;
x
<
h
/
2
;
x
++
)
memcpy
(
audiotrack
->
buf
+
x
*
2
*
w
+
y
*
cfs
,
data
+
x
*
cfs
,
cfs
);
else
for
(
x
=
0
;
x
<
w
/
sps
;
x
++
)
memcpy
(
audiotrack
->
buf
+
sps
*
(
h
*
x
+
((
h
+
1
)
/
2
)
*
(
y
&
1
)
+
(
y
>>
1
)),
data
+
x
*
sps
,
sps
);
if
(
++
audiotrack
->
sub_packet_cnt
>=
h
)
{
audiotrack
->
sub_packet_cnt
=
0
;
audiotrack
->
pkt_cnt
=
h
*
w
/
a
;
}
}
while
(
audiotrack
->
pkt_cnt
)
{
pkt
=
av_mallocz
(
sizeof
(
AVPacket
));
/* XXX: prevent data copy... */
if
(
av_new_packet
(
pkt
,
lace_size
[
n
]
-
offset
)
<
0
)
{
res
=
AVERROR
(
ENOMEM
);
n
=
laces
-
1
;
break
;
}
memcpy
(
pkt
->
data
,
data
+
offset
,
lace_size
[
n
]
-
offset
);
if
(
n
==
0
)
pkt
->
flags
=
is_keyframe
;
pkt
->
stream_index
=
matroska
->
tracks
[
track
]
->
stream_index
;
pkt
->
pts
=
timecode
;
av_new_packet
(
pkt
,
a
);
memcpy
(
pkt
->
data
,
audiotrack
->
buf
+
a
*
(
h
*
w
/
a
-
audiotrack
->
pkt_cnt
--
),
a
);
pkt
->
pos
=
pos
;
pkt
->
duration
=
duration
;
pkt
->
stream_index
=
matroska
->
tracks
[
track
]
->
stream_index
;
matroska_queue_packet
(
matroska
,
pkt
);
}
}
else
{
int
offset
=
0
;
if
(
st
->
codec
->
codec_id
==
CODEC_ID_TEXT
&&
((
MatroskaSubtitleTrack
*
)(
matroska
->
tracks
[
track
]))
->
ass
)
{
int
i
;
for
(
i
=
0
;
i
<
8
&&
data
[
offset
];
offset
++
)
if
(
data
[
offset
]
==
','
)
i
++
;
}
pkt
=
av_mallocz
(
sizeof
(
AVPacket
));
/* XXX: prevent data copy... */
if
(
av_new_packet
(
pkt
,
lace_size
[
n
]
-
offset
)
<
0
)
{
res
=
AVERROR
(
ENOMEM
);
n
=
laces
-
1
;
break
;
}
memcpy
(
pkt
->
data
,
data
+
offset
,
lace_size
[
n
]
-
offset
);
if
(
n
==
0
)
pkt
->
flags
=
is_keyframe
;
pkt
->
stream_index
=
matroska
->
tracks
[
track
]
->
stream_index
;
pkt
->
pts
=
timecode
;
pkt
->
pos
=
pos
;
pkt
->
duration
=
duration
;
matroska_queue_packet
(
matroska
,
pkt
);
}
if
(
timecode
!=
AV_NOPTS_VALUE
)
timecode
=
duration
?
timecode
+
duration
:
AV_NOPTS_VALUE
;
if
(
timecode
!=
AV_NOPTS_VALUE
)
timecode
=
duration
?
timecode
+
duration
:
AV_NOPTS_VALUE
;
data
+=
lace_size
[
n
];
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录