diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-25 02:40:58 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-25 02:42:14 +0300 |
commit | 7d9b06eb179fb0d032c530d21182dce3fe0a7671 (patch) | |
tree | 7be8a4aaa2ed84b83b868f4f636c3a27dfe7b98c /libavformat/rtpdec_vp8.c | |
parent | 6e9bbaca6c6739e6524809d3e786ce1e10ad518b (diff) | |
parent | 199fb40278146c5bb162990c66ad3cd561abc780 (diff) |
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_vp8.c')
-rw-r--r-- | libavformat/rtpdec_vp8.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/libavformat/rtpdec_vp8.c b/libavformat/rtpdec_vp8.c index 0c93e191c9..2f4a40e852 100644 --- a/libavformat/rtpdec_vp8.c +++ b/libavformat/rtpdec_vp8.c @@ -29,6 +29,7 @@ #include "libavcodec/bytestream.h" +#include "avio_internal.h" #include "rtpdec_formats.h" struct PayloadContext { @@ -52,22 +53,12 @@ struct PayloadContext { int got_keyframe; }; -static void vp8_free_buffer(PayloadContext *vp8) -{ - uint8_t *tmp; - if (!vp8->data) - return; - avio_close_dyn_buf(vp8->data, &tmp); - av_free(tmp); - vp8->data = NULL; -} - static int vp8_broken_sequence(AVFormatContext *ctx, PayloadContext *vp8, const char *msg) { vp8->sequence_ok = 0; av_log(ctx, AV_LOG_WARNING, "%s", msg); - vp8_free_buffer(vp8); + ffio_free_dyn_buf(&vp8->data); return AVERROR(EAGAIN); } @@ -150,7 +141,7 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8, int res; int non_key = buf[0] & 0x01; if (!non_key) { - vp8_free_buffer(vp8); + ffio_free_dyn_buf(&vp8->data); // Keyframe, decoding ok again vp8->sequence_ok = 1; vp8->sequence_dirty = 0; @@ -205,7 +196,7 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8, old_timestamp = vp8->timestamp; } else { // Shouldn't happen - vp8_free_buffer(vp8); + ffio_free_dyn_buf(&vp8->data); } } } @@ -277,7 +268,7 @@ static av_cold int vp8_init(AVFormatContext *s, int st_index, PayloadContext *vp static void vp8_free_context(PayloadContext *vp8) { - vp8_free_buffer(vp8); + ffio_free_dyn_buf(&vp8->data); } static int vp8_need_keyframe(PayloadContext *vp8) |