diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-21 12:32:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-21 12:32:28 +0100 |
commit | 34c58618bef02c5584c93e1d39592a309905204b (patch) | |
tree | 3771fea651230fd920a362c0656b950fc093c8a7 /libavformat | |
parent | 621450e786c66b84626f0c7bafcfff6bed330e5d (diff) | |
parent | a3cc519d1f43bf93cc29fd53284a2b8aa6189a9a (diff) |
Merge commit 'a3cc519d1f43bf93cc29fd53284a2b8aa6189a9a'
* commit 'a3cc519d1f43bf93cc29fd53284a2b8aa6189a9a':
rtpdec_h264: Prepare h264_handle_packet_stap_a for sharing with hevc
Conflicts:
libavformat/rtpdec_h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtpdec_h264.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 39e2b9c2b5..4d4170eb8c 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -177,7 +177,8 @@ static int sdp_parse_fmtp_config_h264(AVFormatContext *s, } static int h264_handle_packet_stap_a(AVFormatContext *ctx, PayloadContext *data, AVPacket *pkt, - const uint8_t *buf, int len) + const uint8_t *buf, int len, + int start_skip) { int pass = 0; int total_length = 0; @@ -189,6 +190,9 @@ static int h264_handle_packet_stap_a(AVFormatContext *ctx, PayloadContext *data, const uint8_t *src = buf; int src_len = len; + src += start_skip; + src_len -= start_skip; + while (src_len > 2) { uint16_t nal_size = AV_RB16(src); @@ -215,8 +219,8 @@ static int h264_handle_packet_stap_a(AVFormatContext *ctx, PayloadContext *data, } // eat what we handled - src += nal_size; - src_len -= nal_size; + src += nal_size + start_skip; + src_len -= nal_size + start_skip; } if (pass == 0) { @@ -304,7 +308,7 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data, // consume the STAP-A NAL buf++; len--; - result = h264_handle_packet_stap_a(ctx, data, pkt, buf, len); + result = h264_handle_packet_stap_a(ctx, data, pkt, buf, len, 0); break; case 25: // STAP-B |