Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f490a08f
Commit
f490a08f
authored
Sep 25, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtp: improve S16L to L16 packetization
parent
2db8c89d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
modules/stream_out/rtpfmt.c
modules/stream_out/rtpfmt.c
+20
-20
No files found.
modules/stream_out/rtpfmt.c
View file @
f490a08f
...
...
@@ -926,32 +926,32 @@ static int rtp_packetize_pcm(sout_stream_id_sys_t *id, block_t *in)
}
/* split and convert from little endian to network byte order */
static
int
rtp_packetize_swab
(
sout_stream_id_sys_t
*
id
,
block_t
*
in
)
static
int
rtp_packetize_swab
(
sout_stream_id_sys_t
*
id
,
block_t
*
in
)
{
int
i_max
=
rtp_mtu
(
id
);
/* payload max in one packet */
int
i_count
=
(
in
->
i_buffer
+
i_max
-
1
)
/
i_max
;
uint8_t
*
p_data
=
in
->
p_buffer
;
int
i_data
=
in
->
i_buffer
;
int
i
;
unsigned
max
=
rtp_mtu
(
id
);
for
(
i
=
0
;
i
<
i_count
;
i
++
)
while
(
in
->
i_buffer
>
0
)
{
int
i_payload
=
__MIN
(
i_max
,
i_data
);
block_t
*
out
=
block_Alloc
(
12
+
i_payload
);
/* rtp common header */
rtp_packetize_common
(
id
,
out
,
(
i
==
i_count
-
1
),
(
in
->
i_pts
>
VLC_TS_INVALID
?
in
->
i_pts
:
in
->
i_dts
)
);
swab
(
p_data
,
out
->
p_buffer
+
12
,
i_payload
);
unsigned
payload
=
(
max
<
in
->
i_buffer
)
?
max
:
in
->
i_buffer
;
unsigned
duration
=
(
in
->
i_length
*
payload
)
/
in
->
i_buffer
;
bool
marker
=
(
in
->
i_flags
&
BLOCK_FLAG_DISCONTINUITY
)
!=
0
;
out
->
i_dts
=
in
->
i_dts
+
i
*
in
->
i_length
/
i_count
;
out
->
i_length
=
in
->
i_length
/
i_count
;
block_t
*
out
=
block_Alloc
(
12
+
payload
);
if
(
unlikely
(
out
==
NULL
))
{
block_Release
(
in
);
return
VLC_ENOMEM
;
}
rtp_packetize_send
(
id
,
out
);
rtp_packetize_common
(
id
,
out
,
marker
,
in
->
i_pts
);
swab
(
in
->
p_buffer
,
out
->
p_buffer
+
12
,
payload
);
rtp_packetize_send
(
id
,
out
);
p_data
+=
i_payload
;
i_data
-=
i_payload
;
in
->
p_buffer
+=
payload
;
in
->
i_buffer
-=
payload
;
in
->
i_pts
+=
duration
;
in
->
i_length
-=
duration
;
in
->
i_flags
&=
~
BLOCK_FLAG_DISCONTINUITY
;
}
block_Release
(
in
);
...
...
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