Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2366efce
Commit
2366efce
authored
Sep 23, 2016
by
raymondzheng1412@gmail.com
Committed by
Nicolas George
Sep 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/concatdec: don't call open_file when seek position within a file
parent
13dd5edb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
concatdec.c
libavformat/concatdec.c
+17
-7
No files found.
libavformat/concatdec.c
View file @
2366efce
...
...
@@ -689,7 +689,7 @@ static int try_seek(AVFormatContext *avf, int stream,
}
static
int
real_seek
(
AVFormatContext
*
avf
,
int
stream
,
int64_t
min_ts
,
int64_t
ts
,
int64_t
max_ts
,
int
flags
)
int64_t
min_ts
,
int64_t
ts
,
int64_t
max_ts
,
int
flags
,
AVFormatContext
*
cur_avf
)
{
ConcatContext
*
cat
=
avf
->
priv_data
;
int
ret
,
left
,
right
;
...
...
@@ -711,13 +711,19 @@ static int real_seek(AVFormatContext *avf, int stream,
left
=
mid
;
}
if
((
ret
=
open_file
(
avf
,
left
))
<
0
)
return
ret
;
if
(
cat
->
cur_file
!=
&
cat
->
files
[
left
])
{
if
((
ret
=
open_file
(
avf
,
left
))
<
0
)
return
ret
;
}
else
{
cat
->
avf
=
cur_avf
;
}
ret
=
try_seek
(
avf
,
stream
,
min_ts
,
ts
,
max_ts
,
flags
);
if
(
ret
<
0
&&
left
<
cat
->
nb_files
-
1
&&
cat
->
files
[
left
+
1
].
start_time
<
max_ts
)
{
if
(
cat
->
cur_file
==
&
cat
->
files
[
left
])
cat
->
avf
=
NULL
;
if
((
ret
=
open_file
(
avf
,
left
+
1
))
<
0
)
return
ret
;
ret
=
try_seek
(
avf
,
stream
,
min_ts
,
ts
,
max_ts
,
flags
);
...
...
@@ -738,13 +744,17 @@ static int concat_seek(AVFormatContext *avf, int stream,
if
(
flags
&
(
AVSEEK_FLAG_BYTE
|
AVSEEK_FLAG_FRAME
))
return
AVERROR
(
ENOSYS
);
cat
->
avf
=
NULL
;
if
((
ret
=
real_seek
(
avf
,
stream
,
min_ts
,
ts
,
max_ts
,
flags
))
<
0
)
{
if
(
cat
->
avf
)
avformat_close_input
(
&
cat
->
avf
);
if
((
ret
=
real_seek
(
avf
,
stream
,
min_ts
,
ts
,
max_ts
,
flags
,
cur_avf_saved
))
<
0
)
{
if
(
cat
->
cur_file
!=
cur_file_saved
)
{
if
(
cat
->
avf
)
avformat_close_input
(
&
cat
->
avf
);
}
cat
->
avf
=
cur_avf_saved
;
cat
->
cur_file
=
cur_file_saved
;
}
else
{
avformat_close_input
(
&
cur_avf_saved
);
if
(
cat
->
cur_file
!=
cur_file_saved
)
{
avformat_close_input
(
&
cur_avf_saved
);
}
cat
->
eof
=
0
;
}
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment