aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-07-08 23:53:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-07-08 23:53:08 +0200
commit2a33dc2cdf6d62204f6f5c425c185d714403daa6 (patch)
treeaa3ccf65c4f4accd6630d97c2b092bf332f02ab8
parent91748662bc024294d50e2e0542d727265e331105 (diff)
parentd09b4cce21cdad5ef2855698395ffd6e37445212 (diff)
downloadffmpeg-2a33dc2cdf6d62204f6f5c425c185d714403daa6.tar.gz
Merge commit 'd09b4cce21cdad5ef2855698395ffd6e37445212'
* commit 'd09b4cce21cdad5ef2855698395ffd6e37445212': mpjpeg: Simplify using avio_printf Conflicts: libavformat/mpjpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpjpeg.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/libavformat/mpjpeg.c b/libavformat/mpjpeg.c
index 7b975e28d6..2ea448833f 100644
--- a/libavformat/mpjpeg.c
+++ b/libavformat/mpjpeg.c
@@ -33,10 +33,7 @@ typedef struct MPJPEGContext {
static int mpjpeg_write_header(AVFormatContext *s)
{
MPJPEGContext *mpj = s->priv_data;
- uint8_t buf1[256];
-
- snprintf(buf1, sizeof(buf1), "--%s\r\n", mpj->boundary_tag);
- avio_write(s->pb, buf1, strlen(buf1));
+ avio_printf(s->pb, "--%s\r\n", mpj->boundary_tag);
avio_flush(s->pb);
return 0;
}
@@ -44,17 +41,11 @@ static int mpjpeg_write_header(AVFormatContext *s)
static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MPJPEGContext *mpj = s->priv_data;
- uint8_t buf1[256];
-
- snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\r\n");
- avio_write(s->pb, buf1, strlen(buf1));
-
- snprintf(buf1, sizeof(buf1), "Content-length: %d\r\n\r\n", pkt->size);
- avio_write(s->pb, buf1, strlen(buf1));
+ avio_printf(s->pb, "Content-type: image/jpeg\r\n");
+ avio_printf(s->pb, "Content-length: %d\r\n\r\n", pkt->size);
avio_write(s->pb, pkt->data, pkt->size);
- snprintf(buf1, sizeof(buf1), "\r\n--%s\r\n", mpj->boundary_tag);
- avio_write(s->pb, buf1, strlen(buf1));
+ avio_printf(s->pb, "\r\n--%s\r\n", mpj->boundary_tag);
return 0;
}