Commit 2a33dc2c authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'd09b4cce'

* commit 'd09b4cce':
  mpjpeg: Simplify using avio_printf

Conflicts:
	libavformat/mpjpeg.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 91748662 d09b4cce
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment