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
3eebc1e1
Commit
3eebc1e1
authored
Aug 09, 2012
by
Samuel Pitoiset
Committed by
Luca Barbato
Aug 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmp: Factorize the code by adding handle_invoke_error
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
71036a3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
rtmpproto.c
libavformat/rtmpproto.c
+16
-7
No files found.
libavformat/rtmpproto.c
View file @
3eebc1e1
...
...
@@ -1021,6 +1021,20 @@ static int handle_server_bw(URLContext *s, RTMPPacket *pkt)
return
0
;
}
static
int
handle_invoke_error
(
URLContext
*
s
,
RTMPPacket
*
pkt
)
{
const
uint8_t
*
data_end
=
pkt
->
data
+
pkt
->
data_size
;
uint8_t
tmpstr
[
256
];
if
(
!
ff_amf_get_field_value
(
pkt
->
data
+
9
,
data_end
,
"description"
,
tmpstr
,
sizeof
(
tmpstr
)))
{
av_log
(
s
,
AV_LOG_ERROR
,
"Server error: %s
\n
"
,
tmpstr
);
return
-
1
;
}
return
0
;
}
static
int
handle_invoke_result
(
URLContext
*
s
,
RTMPPacket
*
pkt
)
{
RTMPContext
*
rt
=
s
->
priv_data
;
...
...
@@ -1133,17 +1147,12 @@ static int handle_invoke_status(URLContext *s, RTMPPacket *pkt)
static
int
handle_invoke
(
URLContext
*
s
,
RTMPPacket
*
pkt
)
{
RTMPContext
*
rt
=
s
->
priv_data
;
const
uint8_t
*
data_end
=
pkt
->
data
+
pkt
->
data_size
;
int
ret
=
0
;
//TODO: check for the messages sent for wrong state?
if
(
!
memcmp
(
pkt
->
data
,
"
\002\000\006
_error"
,
9
))
{
uint8_t
tmpstr
[
256
];
if
(
!
ff_amf_get_field_value
(
pkt
->
data
+
9
,
data_end
,
"description"
,
tmpstr
,
sizeof
(
tmpstr
)))
av_log
(
s
,
AV_LOG_ERROR
,
"Server error: %s
\n
"
,
tmpstr
);
return
-
1
;
if
((
ret
=
handle_invoke_error
(
s
,
pkt
))
<
0
)
return
ret
;
}
else
if
(
!
memcmp
(
pkt
->
data
,
"
\002\000\007
_result"
,
10
))
{
if
((
ret
=
handle_invoke_result
(
s
,
pkt
))
<
0
)
return
ret
;
...
...
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