Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
141de5a9
Commit
141de5a9
authored
Dec 26, 2010
by
Peter Ross
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ff_find_stream_index
Originally committed as revision 26092 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
456a70ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
gxf.c
libavformat/gxf.c
+4
-4
internal.h
libavformat/internal.h
+6
-0
utils.c
libavformat/utils.c
+9
-0
No files found.
libavformat/gxf.c
View file @
141de5a9
...
...
@@ -21,6 +21,7 @@
#include "libavutil/common.h"
#include "avformat.h"
#include "internal.h"
#include "gxf.h"
struct
gxf_stream_info
{
...
...
@@ -77,10 +78,9 @@ static int gxf_probe(AVProbeData *p) {
static
int
get_sindex
(
AVFormatContext
*
s
,
int
id
,
int
format
)
{
int
i
;
AVStream
*
st
=
NULL
;
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
if
(
s
->
streams
[
i
]
->
id
==
id
)
return
i
;
}
i
=
ff_find_stream_index
(
s
,
id
);
if
(
i
>=
0
)
return
i
;
st
=
av_new_stream
(
s
,
id
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
...
...
libavformat/internal.h
View file @
141de5a9
...
...
@@ -220,4 +220,10 @@ typedef void (*ff_parse_key_val_cb)(void *context, const char *key,
void
ff_parse_key_value
(
const
char
*
str
,
ff_parse_key_val_cb
callback_get_buf
,
void
*
context
);
/**
* Find stream index based on format-specific stream ID
* @return stream index, or < 0 on error
*/
int
ff_find_stream_index
(
AVFormatContext
*
s
,
int
id
);
#endif
/* AVFORMAT_INTERNAL_H */
libavformat/utils.c
View file @
141de5a9
...
...
@@ -3806,3 +3806,12 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
}
}
int
ff_find_stream_index
(
AVFormatContext
*
s
,
int
id
)
{
int
i
;
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
if
(
s
->
streams
[
i
]
->
id
==
id
)
return
i
;
}
return
-
1
;
}
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