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
567d6d5f
Commit
567d6d5f
authored
Feb 24, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avprobe: add local per-stream state
This will be useful in the following commits.
parent
c9478410
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
avprobe.c
avprobe.c
+20
-0
No files found.
avprobe.c
View file @
567d6d5f
...
...
@@ -32,8 +32,15 @@
#include "libavdevice/avdevice.h"
#include "cmdutils.h"
typedef
struct
InputStream
{
AVStream
*
st
;
}
InputStream
;
typedef
struct
InputFile
{
AVFormatContext
*
fmt_ctx
;
InputStream
*
streams
;
int
nb_streams
;
}
InputFile
;
const
char
program_name
[]
=
"avprobe"
;
...
...
@@ -787,11 +794,20 @@ static int open_input_file(InputFile *ifile, const char *filename)
av_dump_format
(
fmt_ctx
,
0
,
filename
,
0
);
ifile
->
streams
=
av_mallocz_array
(
fmt_ctx
->
nb_streams
,
sizeof
(
*
ifile
->
streams
));
if
(
!
ifile
->
streams
)
exit
(
1
);
ifile
->
nb_streams
=
fmt_ctx
->
nb_streams
;
/* bind a decoder to each input stream */
for
(
i
=
0
;
i
<
fmt_ctx
->
nb_streams
;
i
++
)
{
InputStream
*
ist
=
&
ifile
->
streams
[
i
];
AVStream
*
stream
=
fmt_ctx
->
streams
[
i
];
AVCodec
*
codec
;
ist
->
st
=
stream
;
if
(
stream
->
codec
->
codec_id
==
AV_CODEC_ID_PROBE
)
{
fprintf
(
stderr
,
"Failed to probe codec for input stream %d
\n
"
,
stream
->
index
);
...
...
@@ -820,6 +836,10 @@ static void close_input_file(InputFile *ifile)
avcodec_close
(
stream
->
codec
);
}
av_freep
(
&
ifile
->
streams
);
ifile
->
nb_streams
=
0
;
avformat_close_input
(
&
ifile
->
fmt_ctx
);
}
...
...
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