Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
babf2a34
Commit
babf2a34
authored
May 04, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
seek-test: support manually forcing a seek to a specific position
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4b70bba5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
seek-test.c
libavformat/seek-test.c
+15
-1
No files found.
libavformat/seek-test.c
View file @
babf2a34
...
...
@@ -63,6 +63,16 @@ int main(int argc, char **argv)
int
i
,
ret
,
stream_id
;
int64_t
timestamp
;
AVDictionary
*
format_opts
=
NULL
;
int64_t
seekfirst
;
int
firstback
=
0
;
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"-seekforw"
)){
seekfirst
=
atoi
(
argv
[
3
]);
}
else
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"-seekback"
)){
seekfirst
=
atoi
(
argv
[
3
]);
firstback
=
1
;
}
else
seekfirst
=
AV_NOPTS_VALUE
;
av_dict_set
(
&
format_opts
,
"channels"
,
"1"
,
0
);
av_dict_set
(
&
format_opts
,
"sample_rate"
,
"22050"
,
0
);
...
...
@@ -70,7 +80,7 @@ int main(int argc, char **argv)
/* initialize libavcodec, and register all codecs and formats */
av_register_all
();
if
(
argc
!=
2
)
{
if
(
argc
<
2
)
{
printf
(
"usage: %s input_file
\n
"
"
\n
"
,
argv
[
0
]);
return
1
;
...
...
@@ -91,6 +101,10 @@ int main(int argc, char **argv)
return
1
;
}
if
(
seekfirst
!=
AV_NOPTS_VALUE
){
if
(
firstback
)
avformat_seek_file
(
ic
,
-
1
,
INT64_MIN
,
seekfirst
,
seekfirst
,
0
);
else
avformat_seek_file
(
ic
,
-
1
,
seekfirst
,
seekfirst
,
INT64_MAX
,
0
);
}
for
(
i
=
0
;
;
i
++
){
AVPacket
pkt
=
{
0
};
AVStream
*
av_uninit
(
st
);
...
...
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