]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_latm.c
lavf: split wav muxer and demuxer into separate files.
[ffmpeg] / libavformat / rtpdec_latm.c
index bde34b7ab9633b3f1a7577f246da83711d0aba13..3fa04682b8c098b62fdb75676f8cf32d62fa3c16 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * RTP Depacketization of MP4A-LATM, RFC 3016
  * Copyright (c) 2010 Martin Storsjo
  *
@@ -23,7 +23,6 @@
 #include "internal.h"
 #include "libavutil/avstring.h"
 #include "libavcodec/get_bits.h"
-#include <strings.h>
 
 struct PayloadContext {
     AVIOContext *dyn_buf;
@@ -108,8 +107,7 @@ static int parse_fmtp_config(AVStream *st, char *value)
     int len = ff_hex_to_data(NULL, value), i, ret = 0;
     GetBitContext gb;
     uint8_t *config;
-    int audio_mux_version, same_time_framing, num_sub_frames,
-        num_programs, num_layers;
+    int audio_mux_version, same_time_framing, num_programs, num_layers;
 
     /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */
     config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
@@ -119,7 +117,7 @@ static int parse_fmtp_config(AVStream *st, char *value)
     init_get_bits(&gb, config, len*8);
     audio_mux_version = get_bits(&gb, 1);
     same_time_framing = get_bits(&gb, 1);
-    num_sub_frames    = get_bits(&gb, 6);
+    skip_bits(&gb, 6); /* num_sub_frames */
     num_programs      = get_bits(&gb, 4);
     num_layers        = get_bits(&gb, 3);
     if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 ||
@@ -170,6 +168,9 @@ static int latm_parse_sdp_line(AVFormatContext *s, int st_index,
 {
     const char *p;
 
+    if (st_index < 0)
+        return 0;
+
     if (av_strstart(line, "fmtp:", &p))
         return ff_parse_fmtp(s->streams[st_index], data, p, parse_fmtp);
 
@@ -179,7 +180,7 @@ static int latm_parse_sdp_line(AVFormatContext *s, int st_index,
 RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler = {
     .enc_name           = "MP4A-LATM",
     .codec_type         = AVMEDIA_TYPE_AUDIO,
-    .codec_id           = CODEC_ID_AAC,
+    .codec_id           = AV_CODEC_ID_AAC,
     .parse_sdp_a_line   = latm_parse_sdp_line,
     .alloc              = latm_new_context,
     .free               = latm_free_context,