[09/11] rtpdec_h264: Make start_sequence a static const array

Message ID 1336169215-59789-9-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö May 4, 2012, 10:06 p.m.
---
 libavformat/rtpdec_h264.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Luca Barbato May 5, 2012, midnight | #1
On 04/05/12 15:06, Martin Storsjö wrote:
> ---
>  libavformat/rtpdec_h264.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Ok.

Patch

diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 5abab79..1021d02 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -63,6 +63,8 @@  struct PayloadContext {
 #define COUNT_NAL_TYPE(data, nal) do { } while (0)
 #endif
 
+static const uint8_t start_sequence[] = { 0, 0, 0, 1 };
+
 static int sdp_parse_fmtp_config_h264(AVStream *stream,
                                       PayloadContext *h264_data,
                                       char *attr, char *value)
@@ -107,7 +109,6 @@  static int sdp_parse_fmtp_config_h264(AVStream *stream,
             h264_data->level_idc   = level_idc;
         }
     } else if (!strcmp(attr, "sprop-parameter-sets")) {
-        uint8_t start_sequence[] = { 0, 0, 0, 1 };
         codec->extradata_size = 0;
         codec->extradata = NULL;
 
@@ -168,7 +169,6 @@  static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
     uint8_t nal;
     uint8_t type;
     int result = 0;
-    uint8_t start_sequence[] = { 0, 0, 0, 1 };
 
     if (!len) {
         av_log(ctx, AV_LOG_ERROR, "Empty H264 RTP packet\n");