Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
7e6029f9
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,发现更多精彩内容 >>
提交
7e6029f9
编写于
8月 22, 2011
作者:
A
Alex Converse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lavf utils: Fix bad indentation.
上级
6c7ee2f7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
33 deletion
+34
-33
libavformat/utils.c
libavformat/utils.c
+34
-33
未找到文件。
libavformat/utils.c
浏览文件 @
7e6029f9
...
...
@@ -587,7 +587,7 @@ static int init_input(AVFormatContext *s, const char *filename)
return
0
;
if
((
ret
=
avio_open
(
&
s
->
pb
,
filename
,
AVIO_FLAG_READ
))
<
0
)
return
ret
;
return
ret
;
if
(
s
->
iformat
)
return
0
;
return
av_probe_input_buffer
(
s
->
pb
,
&
s
->
iformat
,
filename
,
s
,
0
,
0
);
...
...
@@ -1146,7 +1146,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
st
->
cur_pkt
.
data
=
NULL
;
assert
(
st
->
cur_len
==
0
);
}
else
{
pkt
->
destruct
=
NULL
;
pkt
->
destruct
=
NULL
;
}
compute_pkt_fields
(
s
,
st
,
st
->
parser
,
pkt
);
...
...
@@ -1760,7 +1760,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f
return
-
1
;
st
=
s
->
streams
[
stream_index
];
/* timestamp for default must be expressed in AV_TIME_BASE units */
/* timestamp for default must be expressed in AV_TIME_BASE units */
timestamp
=
av_rescale
(
timestamp
,
st
->
time_base
.
den
,
AV_TIME_BASE
*
(
int64_t
)
st
->
time_base
.
num
);
}
...
...
@@ -1959,39 +1959,40 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
filesize
=
ic
->
file_size
;
end_time
=
AV_NOPTS_VALUE
;
do
{
offset
=
filesize
-
(
DURATION_MAX_READ_SIZE
<<
retry
);
if
(
offset
<
0
)
offset
=
0
;
offset
=
filesize
-
(
DURATION_MAX_READ_SIZE
<<
retry
);
if
(
offset
<
0
)
offset
=
0
;
avio_seek
(
ic
->
pb
,
offset
,
SEEK_SET
);
read_size
=
0
;
for
(;;)
{
if
(
read_size
>=
DURATION_MAX_READ_SIZE
<<
(
FFMAX
(
retry
-
1
,
0
)))
break
;
avio_seek
(
ic
->
pb
,
offset
,
SEEK_SET
);
read_size
=
0
;
for
(;;)
{
if
(
read_size
>=
DURATION_MAX_READ_SIZE
<<
(
FFMAX
(
retry
-
1
,
0
)))
break
;
do
{
ret
=
av_read_packet
(
ic
,
pkt
);
}
while
(
ret
==
AVERROR
(
EAGAIN
));
if
(
ret
!=
0
)
break
;
read_size
+=
pkt
->
size
;
st
=
ic
->
streams
[
pkt
->
stream_index
];
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
(
st
->
start_time
!=
AV_NOPTS_VALUE
||
st
->
first_dts
!=
AV_NOPTS_VALUE
))
{
duration
=
end_time
=
pkt
->
pts
;
if
(
st
->
start_time
!=
AV_NOPTS_VALUE
)
duration
-=
st
->
start_time
;
else
duration
-=
st
->
first_dts
;
if
(
duration
<
0
)
duration
+=
1LL
<<
st
->
pts_wrap_bits
;
if
(
duration
>
0
)
{
if
(
st
->
duration
==
AV_NOPTS_VALUE
||
st
->
duration
<
duration
)
st
->
duration
=
duration
;
do
{
ret
=
av_read_packet
(
ic
,
pkt
);
}
while
(
ret
==
AVERROR
(
EAGAIN
));
if
(
ret
!=
0
)
break
;
read_size
+=
pkt
->
size
;
st
=
ic
->
streams
[
pkt
->
stream_index
];
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
(
st
->
start_time
!=
AV_NOPTS_VALUE
||
st
->
first_dts
!=
AV_NOPTS_VALUE
))
{
duration
=
end_time
=
pkt
->
pts
;
if
(
st
->
start_time
!=
AV_NOPTS_VALUE
)
duration
-=
st
->
start_time
;
else
duration
-=
st
->
first_dts
;
if
(
duration
<
0
)
duration
+=
1LL
<<
st
->
pts_wrap_bits
;
if
(
duration
>
0
)
{
if
(
st
->
duration
==
AV_NOPTS_VALUE
||
st
->
duration
<
duration
)
st
->
duration
=
duration
;
}
}
av_free_packet
(
pkt
);
}
av_free_packet
(
pkt
);
}
}
while
(
end_time
==
AV_NOPTS_VALUE
&&
filesize
>
(
DURATION_MAX_READ_SIZE
<<
retry
)
&&
++
retry
<=
DURATION_MAX_RETRY
);
...
...
@@ -3914,7 +3915,7 @@ int avformat_query_codec(AVOutputFormat *ofmt, enum CodecID codec_id, int std_co
return
!!
av_codec_get_tag
(
ofmt
->
codec_tag
,
codec_id
);
else
if
(
codec_id
==
ofmt
->
video_codec
||
codec_id
==
ofmt
->
audio_codec
||
codec_id
==
ofmt
->
subtitle_codec
)
return
1
;
return
1
;
}
return
AVERROR_PATCHWELCOME
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录