]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_h264.c
configure: Do not unconditionally add -Wall to host CFLAGS.
[ffmpeg] / libavformat / rtpdec_h264.c
index 06e30ab953fc2ef47c5f03cae86a108ca6eaa9a2..effdc1fe66c498941a95111e25851c589acab2e0 100644 (file)
@@ -2,20 +2,20 @@
  * RTP H264 Protocol (RFC3984)
  * Copyright (c) 2006 Ryan Martell
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -47,7 +47,7 @@
 #include <assert.h>
 
 #include "rtpdec.h"
-#include "rtpdec_h264.h"
+#include "rtpdec_formats.h"
 
 /**
     RTP/H264 specific private data.
@@ -120,7 +120,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream,
         while (*value) {
             char base64packet[1024];
             uint8_t decoded_packet[1024];
-            uint32_t packet_size;
+            int packet_size;
             char *dst = base64packet;
 
             while (*value && *value != ','
@@ -133,7 +133,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream,
                 value++;
 
             packet_size= av_base64_decode(decoded_packet, base64packet, sizeof(decoded_packet));
-            if (packet_size) {
+            if (packet_size > 0) {
                 uint8_t *dest = av_malloc(packet_size + sizeof(start_sequence) +
                                          codec->extradata_size +
                                          FF_INPUT_BUFFER_PADDING_SIZE);
@@ -187,10 +187,7 @@ static int h264_handle_packet(AVFormatContext *ctx,
     if (type >= 1 && type <= 23)
         type = 1;              // simplify the case. (these are all the nal types used internally by the h264 codec)
     switch (type) {
-    case 0:                    // undefined;
-        result= -1;
-        break;
-
+    case 0:                    // undefined, but pass them through
     case 1:
         av_new_packet(pkt, len+sizeof(start_sequence));
         memcpy(pkt->data, start_sequence, sizeof(start_sequence));
@@ -401,7 +398,7 @@ RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
     .codec_type       = AVMEDIA_TYPE_VIDEO,
     .codec_id         = CODEC_ID_H264,
     .parse_sdp_a_line = parse_h264_sdp_line,
-    .open             = h264_new_context,
-    .close            = h264_free_context,
+    .alloc            = h264_new_context,
+    .free             = h264_free_context,
     .parse_packet     = h264_handle_packet
 };