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
6bf87785
Commit
6bf87785
authored
Jul 25, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: warn about new streams after startup.
parent
d0d92725
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
ffmpeg.c
ffmpeg.c
+19
-1
No files found.
ffmpeg.c
View file @
6bf87785
...
...
@@ -267,6 +267,7 @@ typedef struct InputFile {
int64_t
ts_offset
;
int
nb_streams
;
/* number of stream that ffmpeg is aware of; may be different
from ctx.nb_streams if new streams appear during av_read_frame() */
int
nb_streams_warn
;
/* number of streams that the user was warned of */
int
rate_emu
;
#if HAVE_PTHREADS
...
...
@@ -2873,6 +2874,21 @@ static void parse_forced_key_frames(char *kf, OutputStream *ost,
}
}
static
void
report_new_stream
(
int
input_index
,
AVPacket
*
pkt
)
{
InputFile
*
file
=
input_files
[
input_index
];
AVStream
*
st
=
file
->
ctx
->
streams
[
pkt
->
stream_index
];
if
(
pkt
->
stream_index
<
file
->
nb_streams_warn
)
return
;
av_log
(
file
->
ctx
,
AV_LOG_WARNING
,
"New %s stream %d:%d at pos:%"
PRId64
" and DTS:%ss
\n
"
,
av_get_media_type_string
(
st
->
codec
->
codec_type
),
input_index
,
pkt
->
stream_index
,
pkt
->
pos
,
av_ts2timestr
(
pkt
->
dts
,
&
st
->
time_base
));
file
->
nb_streams_warn
=
pkt
->
stream_index
+
1
;
}
static
int
transcode_init
(
void
)
{
int
ret
=
0
,
i
,
j
,
k
;
...
...
@@ -3732,8 +3748,10 @@ static int transcode(void)
}
/* the following test is needed in case new streams appear
dynamically in stream : we ignore them */
if
(
pkt
.
stream_index
>=
input_files
[
file_index
]
->
nb_streams
)
if
(
pkt
.
stream_index
>=
input_files
[
file_index
]
->
nb_streams
)
{
report_new_stream
(
file_index
,
&
pkt
);
goto
discard_packet
;
}
ist_index
=
input_files
[
file_index
]
->
ist_index
+
pkt
.
stream_index
;
ist
=
input_streams
[
ist_index
];
if
(
ist
->
discard
)
...
...
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