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
49d935b5
Commit
49d935b5
authored
May 04, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
seek-test: support printing multiple packets
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ef32fbaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
seek-test.c
libavformat/seek-test.c
+18
-9
No files found.
libavformat/seek-test.c
View file @
49d935b5
...
@@ -61,18 +61,25 @@ int main(int argc, char **argv)
...
@@ -61,18 +61,25 @@ int main(int argc, char **argv)
const
char
*
filename
;
const
char
*
filename
;
AVFormatContext
*
ic
=
NULL
;
AVFormatContext
*
ic
=
NULL
;
int
i
,
ret
,
stream_id
;
int
i
,
ret
,
stream_id
;
int
j
;
int64_t
timestamp
;
int64_t
timestamp
;
AVDictionary
*
format_opts
=
NULL
;
AVDictionary
*
format_opts
=
NULL
;
int64_t
seekfirst
;
int64_t
seekfirst
=
AV_NOPTS_VALUE
;
int
firstback
=
0
;
int
firstback
=
0
;
int
frame_count
=
1
;
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"-seekforw"
)){
seekfirst
=
atoi
(
argv
[
3
]);
for
(
i
=
2
;
i
<
argc
;
i
+=
2
){
}
else
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"-seekback"
)){
if
(
!
strcmp
(
argv
[
i
],
"-seekforw"
)){
seekfirst
=
atoi
(
argv
[
3
]);
seekfirst
=
atoi
(
argv
[
i
+
1
]);
firstback
=
1
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-seekback"
)){
}
else
seekfirst
=
atoi
(
argv
[
i
+
1
]);
seekfirst
=
AV_NOPTS_VALUE
;
firstback
=
1
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-frames"
)){
frame_count
=
atoi
(
argv
[
i
+
1
]);
}
else
{
argc
=
1
;
}
}
av_dict_set
(
&
format_opts
,
"channels"
,
"1"
,
0
);
av_dict_set
(
&
format_opts
,
"channels"
,
"1"
,
0
);
av_dict_set
(
&
format_opts
,
"sample_rate"
,
"22050"
,
0
);
av_dict_set
(
&
format_opts
,
"sample_rate"
,
"22050"
,
0
);
...
@@ -111,6 +118,7 @@ int main(int argc, char **argv)
...
@@ -111,6 +118,7 @@ int main(int argc, char **argv)
char
ts_buf
[
60
];
char
ts_buf
[
60
];
if
(
ret
>=
0
){
if
(
ret
>=
0
){
for
(
j
=
0
;
j
<
frame_count
;
j
++
)
{
ret
=
av_read_frame
(
ic
,
&
pkt
);
ret
=
av_read_frame
(
ic
,
&
pkt
);
if
(
ret
>=
0
){
if
(
ret
>=
0
){
char
dts_buf
[
60
];
char
dts_buf
[
60
];
...
@@ -122,6 +130,7 @@ int main(int argc, char **argv)
...
@@ -122,6 +130,7 @@ int main(int argc, char **argv)
}
else
}
else
printf
(
"ret:%s"
,
ret_str
(
ret
));
// necessary to avoid trailing whitespace
printf
(
"ret:%s"
,
ret_str
(
ret
));
// necessary to avoid trailing whitespace
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
}
if
(
i
>
25
)
break
;
if
(
i
>
25
)
break
;
...
...
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