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
3c3b8003
Commit
3c3b8003
authored
Nov 24, 2014
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmpproto: Simplify code for copying data into the output packet
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
857e6667
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
rtmpproto.c
libavformat/rtmpproto.c
+6
-11
No files found.
libavformat/rtmpproto.c
View file @
3c3b8003
...
@@ -2933,7 +2933,7 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
...
@@ -2933,7 +2933,7 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
{
{
RTMPContext
*
rt
=
s
->
priv_data
;
RTMPContext
*
rt
=
s
->
priv_data
;
int
size_temp
=
size
;
int
size_temp
=
size
;
int
pktsize
,
pkttype
;
int
pktsize
,
pkttype
,
copy
;
uint32_t
ts
;
uint32_t
ts
;
const
uint8_t
*
buf_temp
=
buf
;
const
uint8_t
*
buf_temp
=
buf
;
uint8_t
c
;
uint8_t
c
;
...
@@ -2950,8 +2950,8 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
...
@@ -2950,8 +2950,8 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
if
(
rt
->
flv_header_bytes
<
RTMP_HEADER
)
{
if
(
rt
->
flv_header_bytes
<
RTMP_HEADER
)
{
const
uint8_t
*
header
=
rt
->
flv_header
;
const
uint8_t
*
header
=
rt
->
flv_header
;
int
copy
=
FFMIN
(
RTMP_HEADER
-
rt
->
flv_header_bytes
,
size_temp
);
int
channel
=
RTMP_AUDIO_CHANNEL
;
int
channel
=
RTMP_AUDIO_CHANNEL
;
copy
=
FFMIN
(
RTMP_HEADER
-
rt
->
flv_header_bytes
,
size_temp
);
bytestream_get_buffer
(
&
buf_temp
,
rt
->
flv_header
+
rt
->
flv_header_bytes
,
copy
);
bytestream_get_buffer
(
&
buf_temp
,
rt
->
flv_header
+
rt
->
flv_header_bytes
,
copy
);
rt
->
flv_header_bytes
+=
copy
;
rt
->
flv_header_bytes
+=
copy
;
size_temp
-=
copy
;
size_temp
-=
copy
;
...
@@ -2994,15 +2994,10 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
...
@@ -2994,15 +2994,10 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
ff_amf_write_string
(
&
rt
->
flv_data
,
"@setDataFrame"
);
ff_amf_write_string
(
&
rt
->
flv_data
,
"@setDataFrame"
);
}
}
if
(
rt
->
flv_size
-
rt
->
flv_off
>
size_temp
)
{
copy
=
FFMIN
(
rt
->
flv_size
-
rt
->
flv_off
,
size_temp
);
bytestream_get_buffer
(
&
buf_temp
,
rt
->
flv_data
+
rt
->
flv_off
,
size_temp
);
bytestream_get_buffer
(
&
buf_temp
,
rt
->
flv_data
+
rt
->
flv_off
,
copy
);
rt
->
flv_off
+=
size_temp
;
rt
->
flv_off
+=
copy
;
size_temp
=
0
;
size_temp
-=
copy
;
}
else
{
bytestream_get_buffer
(
&
buf_temp
,
rt
->
flv_data
+
rt
->
flv_off
,
rt
->
flv_size
-
rt
->
flv_off
);
size_temp
-=
rt
->
flv_size
-
rt
->
flv_off
;
rt
->
flv_off
+=
rt
->
flv_size
-
rt
->
flv_off
;
}
if
(
rt
->
flv_off
==
rt
->
flv_size
)
{
if
(
rt
->
flv_off
==
rt
->
flv_size
)
{
rt
->
skip_bytes
=
4
;
rt
->
skip_bytes
=
4
;
...
...
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