summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_jpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-25 00:40:58 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-25 00:42:14 +0100
commit7d9b06eb179fb0d032c530d21182dce3fe0a7671 (patch)
tree7be8a4aaa2ed84b83b868f4f636c3a27dfe7b98c /libavformat/rtpdec_jpeg.c
parent6e9bbaca6c6739e6524809d3e786ce1e10ad518b (diff)
parent199fb40278146c5bb162990c66ad3cd561abc780 (diff)
downloadffmpeg-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_jpeg.c')
-rw-r--r--libavformat/rtpdec_jpeg.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c
index 7c1e7181ae..ca4debef99 100644
--- a/libavformat/rtpdec_jpeg.c
+++ b/libavformat/rtpdec_jpeg.c
@@ -20,6 +20,7 @@
*/
#include "avformat.h"
+#include "avio_internal.h"
#include "rtpdec.h"
#include "rtpdec_formats.h"
#include "libavutil/intreadwrite.h"
@@ -59,19 +60,9 @@ static const uint8_t default_quantizers[128] = {
99, 99, 99, 99, 99, 99, 99, 99
};
-static void free_frame(PayloadContext *jpeg)
-{
- if (jpeg->frame) {
- uint8_t *p;
- avio_close_dyn_buf(jpeg->frame, &p);
- av_free(p);
- jpeg->frame = NULL;
- }
-}
-
static void jpeg_free_context(PayloadContext *jpeg)
{
- free_frame(jpeg);
+ ffio_free_dyn_buf(&jpeg->frame);
}
static int jpeg_create_huffman_table(PutByteContext *p, int table_class,
@@ -332,7 +323,7 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
/* Skip the current frame in case of the end packet
* has been lost somewhere. */
- free_frame(jpeg);
+ ffio_free_dyn_buf(&jpeg->frame);
if ((ret = avio_open_dyn_buf(&jpeg->frame)) < 0)
return ret;
@@ -358,7 +349,7 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
if (jpeg->timestamp != *timestamp) {
/* Skip the current frame if timestamp is incorrect.
* A start packet has been lost somewhere. */
- free_frame(jpeg);
+ ffio_free_dyn_buf(&jpeg->frame);
av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match.\n");
return AVERROR_INVALIDDATA;
}