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
912ecc9a
Commit
912ecc9a
authored
Jul 21, 2012
by
Samuel Pitoiset
Committed by
Martin Storsjö
Jul 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmp: Factorize the code by adding handle_client_bw
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
9b498148
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
rtmpproto.c
libavformat/rtmpproto.c
+18
-8
No files found.
libavformat/rtmpproto.c
View file @
912ecc9a
...
...
@@ -880,6 +880,22 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
return
0
;
}
static
int
handle_client_bw
(
URLContext
*
s
,
RTMPPacket
*
pkt
)
{
RTMPContext
*
rt
=
s
->
priv_data
;
if
(
pkt
->
data_size
<
4
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Client bandwidth report packet is less than 4 bytes long (%d)
\n
"
,
pkt
->
data_size
);
return
-
1
;
}
av_log
(
s
,
AV_LOG_DEBUG
,
"Client bandwidth = %d
\n
"
,
AV_RB32
(
pkt
->
data
));
rt
->
client_report_size
=
AV_RB32
(
pkt
->
data
)
>>
1
;
return
0
;
}
static
int
handle_server_bw
(
URLContext
*
s
,
RTMPPacket
*
pkt
)
{
RTMPContext
*
rt
=
s
->
priv_data
;
...
...
@@ -936,14 +952,8 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
return
ret
;
break
;
case
RTMP_PT_CLIENT_BW
:
if
(
pkt
->
data_size
<
4
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Client bandwidth report packet is less than 4 bytes long (%d)
\n
"
,
pkt
->
data_size
);
return
-
1
;
}
av_log
(
s
,
AV_LOG_DEBUG
,
"Client bandwidth = %d
\n
"
,
AV_RB32
(
pkt
->
data
));
rt
->
client_report_size
=
AV_RB32
(
pkt
->
data
)
>>
1
;
if
((
ret
=
handle_client_bw
(
s
,
pkt
))
<
0
)
return
ret
;
break
;
case
RTMP_PT_SERVER_BW
:
if
((
ret
=
handle_server_bw
(
s
,
pkt
))
<
0
)
...
...
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