Commit d09b4cce authored by Luca Barbato's avatar Luca Barbato

mpjpeg: Simplify using avio_printf

parent f046c3b5
...@@ -26,24 +26,17 @@ ...@@ -26,24 +26,17 @@
static int mpjpeg_write_header(AVFormatContext *s) static int mpjpeg_write_header(AVFormatContext *s)
{ {
uint8_t buf1[256]; avio_printf(s->pb, "--%s\n", BOUNDARY_TAG);
snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG);
avio_write(s->pb, buf1, strlen(buf1));
avio_flush(s->pb); avio_flush(s->pb);
return 0; return 0;
} }
static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt) static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
{ {
uint8_t buf1[256]; avio_printf(s->pb, "Content-type: image/jpeg\n\n");
snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\n\n");
avio_write(s->pb, buf1, strlen(buf1));
avio_write(s->pb, pkt->data, pkt->size); avio_write(s->pb, pkt->data, pkt->size);
snprintf(buf1, sizeof(buf1), "\n--%s\n", BOUNDARY_TAG); avio_printf(s->pb, "\n--%s\n", BOUNDARY_TAG);
avio_write(s->pb, buf1, strlen(buf1));
return 0; 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