summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_mpeg4.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-08-09 10:05:33 +0000
committerMartin Storsjö <martin@martin.st>2010-08-09 10:05:33 +0000
commit311baee795009809daff8a0dd0b27225dcf819ae (patch)
tree79ea97f836fd4a61ec56bb00a52836a6d1eef033 /libavformat/rtpdec_mpeg4.c
parentf240ed18efd80abc6df0bdce13cf0ca708f283ae (diff)
downloadffmpeg-311baee795009809daff8a0dd0b27225dcf819ae.tar.gz
Make hex_to_data a lavf internal function
This is useful for other future RTP depacketizers Originally committed as revision 24747 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec_mpeg4.c')
-rw-r--r--libavformat/rtpdec_mpeg4.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c
index cf309cd3b3..137dbd2613 100644
--- a/libavformat/rtpdec_mpeg4.c
+++ b/libavformat/rtpdec_mpeg4.c
@@ -61,35 +61,6 @@ struct PayloadContext
int cur_au_index;
};
-/* return the length and optionally the data */
-static int hex_to_data(uint8_t *data, const char *p)
-{
- int c, len, v;
-
- len = 0;
- v = 1;
- for (;;) {
- p += strspn(p, SPACE_CHARS);
- if (*p == '\0')
- break;
- c = toupper((unsigned char) *p++);
- if (c >= '0' && c <= '9')
- c = c - '0';
- else if (c >= 'A' && c <= 'F')
- c = c - 'A' + 10;
- else
- break;
- v = (v << 4) | c;
- if (v & 0x100) {
- if (data)
- data[len] = v;
- len++;
- v = 1;
- }
- }
- return len;
-}
-
typedef struct {
const char *str;
uint16_t type;
@@ -139,14 +110,14 @@ static void free_context(PayloadContext * data)
static int parse_fmtp_config(AVCodecContext * codec, char *value)
{
/* decode the hexa encoded parameter */
- int len = hex_to_data(NULL, value);
+ int len = ff_hex_to_data(NULL, value);
if (codec->extradata)
av_free(codec->extradata);
codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
if (!codec->extradata)
return AVERROR(ENOMEM);
codec->extradata_size = len;
- hex_to_data(codec->extradata, value);
+ ff_hex_to_data(codec->extradata, value);
return 0;
}