diff options
author | Martin Storsjö <martin@martin.st> | 2015-02-24 13:37:03 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2015-02-24 23:07:44 +0200 |
commit | 199fb40278146c5bb162990c66ad3cd561abc780 (patch) | |
tree | 0411eef55863c799202a17254b8cc30e9601d28f /libavformat/rtpdec_xiph.c | |
parent | 8a273a746061a112e5e35066a8fd8e146d821a62 (diff) | |
download | ffmpeg-199fb40278146c5bb162990c66ad3cd561abc780.tar.gz |
rtpdec: Use ffio_free_dyn_buf
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpdec_xiph.c')
-rw-r--r-- | libavformat/rtpdec_xiph.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c index 5d0dc69dc2..83cccd9094 100644 --- a/libavformat/rtpdec_xiph.c +++ b/libavformat/rtpdec_xiph.c @@ -34,6 +34,7 @@ #include <assert.h> +#include "avio_internal.h" #include "rtpdec.h" #include "rtpdec_formats.h" @@ -49,19 +50,9 @@ struct PayloadContext { int split_pkts; }; -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 xiph_free_context(PayloadContext * data) { - free_fragment(data); + ffio_free_dyn_buf(&data->fragment); av_free(data->split_buf); } @@ -168,7 +159,7 @@ static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data, int res; // end packet has been lost somewhere, so drop buffered data - free_fragment(data); + ffio_free_dyn_buf(&data->fragment); if((res = avio_open_dyn_buf(&data->fragment)) < 0) return res; @@ -181,7 +172,7 @@ static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data, if (data->timestamp != *timestamp) { // skip if fragmented timestamp is incorrect; // a start packet has been lost somewhere - free_fragment(data); + ffio_free_dyn_buf(&data->fragment); av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match!\n"); return AVERROR_INVALIDDATA; } |