diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-25 00:40:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-25 00:42:14 +0100 |
commit | 7d9b06eb179fb0d032c530d21182dce3fe0a7671 (patch) | |
tree | 7be8a4aaa2ed84b83b868f4f636c3a27dfe7b98c /libavformat/rtpdec_mpa_robust.c | |
parent | 6e9bbaca6c6739e6524809d3e786ce1e10ad518b (diff) | |
parent | 199fb40278146c5bb162990c66ad3cd561abc780 (diff) | |
download | ffmpeg-7d9b06eb179fb0d032c530d21182dce3fe0a7671.tar.gz |
Merge commit '199fb40278146c5bb162990c66ad3cd561abc780'
* commit '199fb40278146c5bb162990c66ad3cd561abc780':
rtpdec: Use ffio_free_dyn_buf
Conflicts:
libavformat/rtpdec_latm.c
libavformat/rtpdec_svq3.c
libavformat/rtpdec_xiph.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpdec_mpa_robust.c')
-rw-r--r-- | libavformat/rtpdec_mpa_robust.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/libavformat/rtpdec_mpa_robust.c b/libavformat/rtpdec_mpa_robust.c index 313062d30f..2c3dc0c742 100644 --- a/libavformat/rtpdec_mpa_robust.c +++ b/libavformat/rtpdec_mpa_robust.c @@ -22,6 +22,7 @@ #include "libavutil/attributes.h" #include "libavutil/intreadwrite.h" +#include "avio_internal.h" #include "rtpdec_formats.h" struct PayloadContext { @@ -33,19 +34,9 @@ struct PayloadContext { AVIOContext *fragment; }; -static void free_fragment(PayloadContext *data) -{ - if (data->fragment) { - uint8_t *p; - avio_close_dyn_buf(data->fragment, &p); - av_free(p); - data->fragment = NULL; - } -} - static void mpa_robust_free_context(PayloadContext *data) { - free_fragment(data); + ffio_free_dyn_buf(&data->fragment); av_free(data->split_buf); } @@ -154,7 +145,7 @@ static int mpa_robust_parse_packet(AVFormatContext *ctx, PayloadContext *data, return 0; } else if (!continuation) { /* && adu_size > len */ /* First fragment */ - free_fragment(data); + ffio_free_dyn_buf(&data->fragment); data->adu_size = adu_size; data->cur_size = len; @@ -177,7 +168,7 @@ static int mpa_robust_parse_packet(AVFormatContext *ctx, PayloadContext *data, } if (adu_size = data->adu_size || data->timestamp != *timestamp) { - free_fragment(data); + ffio_free_dyn_buf(&data->fragment); av_log(ctx, AV_LOG_ERROR, "Invalid packet received\n"); return AVERROR_INVALIDDATA; } |