Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
1430ae44
Commit
1430ae44
authored
Sep 26, 2011
by
Rafaël Carré
Committed by
Martin Storsjö
Sep 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtp: Simplify ff_rtp_get_payload_type
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
9152880e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
rtp.c
libavformat/rtp.c
+11
-14
No files found.
libavformat/rtp.c
View file @
1430ae44
...
@@ -92,32 +92,29 @@ int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type)
...
@@ -92,32 +92,29 @@ int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type)
int
ff_rtp_get_payload_type
(
AVFormatContext
*
fmt
,
AVCodecContext
*
codec
)
int
ff_rtp_get_payload_type
(
AVFormatContext
*
fmt
,
AVCodecContext
*
codec
)
{
{
int
i
,
payload_type
;
int
i
;
AVOutputFormat
*
ofmt
=
fmt
?
fmt
->
oformat
:
NULL
;
AVOutputFormat
*
ofmt
=
fmt
?
fmt
->
oformat
:
NULL
;
/* Was the payload type already specified for the RTP muxer? */
/* Was the payload type already specified for the RTP muxer? */
if
(
ofmt
&&
ofmt
->
priv_class
)
if
(
ofmt
&&
ofmt
->
priv_class
)
{
payload_type
=
av_get_int
(
fmt
->
priv_data
,
"payload_type"
,
NULL
);
int
payload_type
=
av_get_int
(
fmt
->
priv_data
,
"payload_type"
,
NULL
);
if
(
payload_type
>=
0
)
if
(
payload_type
>=
0
)
return
payload_type
;
return
payload_type
;
}
/*
compute the
payload type */
/*
static
payload type */
for
(
payload_type
=
-
1
,
i
=
0
;
AVRtpPayloadTypes
[
i
].
pt
>=
0
;
++
i
)
for
(
i
=
0
;
AVRtpPayloadTypes
[
i
].
pt
>=
0
;
++
i
)
if
(
AVRtpPayloadTypes
[
i
].
codec_id
==
codec
->
codec_id
)
{
if
(
AVRtpPayloadTypes
[
i
].
codec_id
==
codec
->
codec_id
)
{
if
(
codec
->
codec_id
==
CODEC_ID_H263
)
if
(
codec
->
codec_id
==
CODEC_ID_H263
)
continue
;
continue
;
if
(
codec
->
codec_id
==
CODEC_ID_PCM_S16BE
)
if
(
codec
->
codec_id
==
CODEC_ID_PCM_S16BE
)
if
(
codec
->
channels
!=
AVRtpPayloadTypes
[
i
].
audio_channels
)
if
(
codec
->
channels
!=
AVRtpPayloadTypes
[
i
].
audio_channels
)
continue
;
continue
;
payload_type
=
AVRtpPayloadTypes
[
i
].
pt
;
return
AVRtpPayloadTypes
[
i
].
pt
;
}
}
/* dynamic payload type */
/* dynamic payload type */
if
(
payload_type
<
0
)
return
RTP_PT_PRIVATE
+
(
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
);
payload_type
=
RTP_PT_PRIVATE
+
(
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
);
return
payload_type
;
}
}
const
char
*
ff_rtp_enc_name
(
int
payload_type
)
const
char
*
ff_rtp_enc_name
(
int
payload_type
)
...
...
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