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_h261.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_h261.c')
-rw-r--r-- | libavformat/rtpdec_h261.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/libavformat/rtpdec_h261.c b/libavformat/rtpdec_h261.c index b2d2a53f1c..6ca385fd80 100644 --- a/libavformat/rtpdec_h261.c +++ b/libavformat/rtpdec_h261.c @@ -21,6 +21,7 @@ #include "libavcodec/get_bits.h" #include "avformat.h" +#include "avio_internal.h" #include "rtpdec_formats.h" #define RTP_H261_PAYLOAD_HEADER_SIZE 4 @@ -32,14 +33,6 @@ struct PayloadContext { uint32_t timestamp; }; -static void h261_free_dyn_buffer(AVIOContext **dyn_buf) -{ - uint8_t *ptr_dyn_buffer; - avio_close_dyn_buf(*dyn_buf, &ptr_dyn_buffer); - av_free(ptr_dyn_buffer); - *dyn_buf = NULL; -} - static av_cold void h261_free_context(PayloadContext *pl_ctx) { /* return if context is invalid */ @@ -47,9 +40,7 @@ static av_cold void h261_free_context(PayloadContext *pl_ctx) return; /* free buffer if it is valid */ - if (pl_ctx->buf) { - h261_free_dyn_buffer(&pl_ctx->buf); - } + ffio_free_dyn_buf(&pl_ctx->buf); } static int h261_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_h261_ctx, @@ -62,7 +53,7 @@ static int h261_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_h261_ctx /* drop data of previous packets in case of non-continuous (lossy) packet stream */ if (rtp_h261_ctx->buf && rtp_h261_ctx->timestamp != *timestamp) { - h261_free_dyn_buffer(&rtp_h261_ctx->buf); + ffio_free_dyn_buf(&rtp_h261_ctx->buf); rtp_h261_ctx->endbyte_bits = 0; } |