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
0e1e5d00
Commit
0e1e5d00
authored
Nov 28, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffserver: improve error feedback in open_input_stream()
parent
ddab4199
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
ffserver.c
ffserver.c
+16
-9
No files found.
ffserver.c
View file @
0e1e5d00
...
@@ -2184,8 +2184,10 @@ static int open_input_stream(HTTPContext *c, const char *info)
...
@@ -2184,8 +2184,10 @@ static int open_input_stream(HTTPContext *c, const char *info)
buf_size
=
FFM_PACKET_SIZE
;
buf_size
=
FFM_PACKET_SIZE
;
/* compute position (absolute time) */
/* compute position (absolute time) */
if
(
av_find_info_tag
(
buf
,
sizeof
(
buf
),
"date"
,
info
))
{
if
(
av_find_info_tag
(
buf
,
sizeof
(
buf
),
"date"
,
info
))
{
if
((
ret
=
av_parse_time
(
&
stream_pos
,
buf
,
0
))
<
0
)
if
((
ret
=
av_parse_time
(
&
stream_pos
,
buf
,
0
))
<
0
)
{
http_log
(
"Invalid date specification '%s' for stream
\n
"
,
buf
);
return
ret
;
return
ret
;
}
}
else
if
(
av_find_info_tag
(
buf
,
sizeof
(
buf
),
"buffer"
,
info
))
{
}
else
if
(
av_find_info_tag
(
buf
,
sizeof
(
buf
),
"buffer"
,
info
))
{
int
prebuffer
=
strtol
(
buf
,
0
,
10
);
int
prebuffer
=
strtol
(
buf
,
0
,
10
);
stream_pos
=
av_gettime
()
-
prebuffer
*
(
int64_t
)
1000000
;
stream_pos
=
av_gettime
()
-
prebuffer
*
(
int64_t
)
1000000
;
...
@@ -2196,18 +2198,22 @@ static int open_input_stream(HTTPContext *c, const char *info)
...
@@ -2196,18 +2198,22 @@ static int open_input_stream(HTTPContext *c, const char *info)
buf_size
=
0
;
buf_size
=
0
;
/* compute position (relative time) */
/* compute position (relative time) */
if
(
av_find_info_tag
(
buf
,
sizeof
(
buf
),
"date"
,
info
))
{
if
(
av_find_info_tag
(
buf
,
sizeof
(
buf
),
"date"
,
info
))
{
if
((
ret
=
av_parse_time
(
&
stream_pos
,
buf
,
1
))
<
0
)
if
((
ret
=
av_parse_time
(
&
stream_pos
,
buf
,
1
))
<
0
)
{
http_log
(
"Invalid date specification '%s' for stream
\n
"
,
buf
);
return
ret
;
return
ret
;
}
}
else
}
else
stream_pos
=
0
;
stream_pos
=
0
;
}
}
if
(
input_filename
[
0
]
==
'\0'
)
if
(
!
input_filename
[
0
])
{
return
-
1
;
http_log
(
"No filename was specified for stream
\n
"
);
return
AVERROR
(
EINVAL
);
}
/* open stream */
/* open stream */
if
((
ret
=
avformat_open_input
(
&
s
,
input_filename
,
c
->
stream
->
ifmt
,
&
c
->
stream
->
in_opts
))
<
0
)
{
if
((
ret
=
avformat_open_input
(
&
s
,
input_filename
,
c
->
stream
->
ifmt
,
&
c
->
stream
->
in_opts
))
<
0
)
{
http_log
(
"
could not open %s: %d
\n
"
,
input_filename
,
ret
);
http_log
(
"
Could not open input '%s': %s
\n
"
,
input_filename
,
av_err2str
(
ret
)
);
return
-
1
;
return
ret
;
}
}
/* set buffer size */
/* set buffer size */
...
@@ -2215,10 +2221,11 @@ static int open_input_stream(HTTPContext *c, const char *info)
...
@@ -2215,10 +2221,11 @@ static int open_input_stream(HTTPContext *c, const char *info)
s
->
flags
|=
AVFMT_FLAG_GENPTS
;
s
->
flags
|=
AVFMT_FLAG_GENPTS
;
c
->
fmt_in
=
s
;
c
->
fmt_in
=
s
;
if
(
strcmp
(
s
->
iformat
->
name
,
"ffm"
)
&&
avformat_find_stream_info
(
c
->
fmt_in
,
NULL
)
<
0
)
{
if
(
strcmp
(
s
->
iformat
->
name
,
"ffm"
)
&&
http_log
(
"Could not find stream info '%s'
\n
"
,
input_filename
);
(
ret
=
avformat_find_stream_info
(
c
->
fmt_in
,
NULL
))
<
0
)
{
http_log
(
"Could not find stream info for input '%s'
\n
"
,
input_filename
);
avformat_close_input
(
&
s
);
avformat_close_input
(
&
s
);
return
-
1
;
return
ret
;
}
}
/* choose stream as clock source (we favorize video stream if
/* choose stream as clock source (we favorize video stream if
...
...
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