]> git.sesse.net Git - nageru/blobdiff - nageru/kaeru.cpp
Make it possible to siphon out a single MJPEG stream.
[nageru] / nageru / kaeru.cpp
index d9b1e0e0a2d2424433c783068f6aa441c7c9717b..cf14bf35d404f7f117798bc8c6d69c3500ef2419 100644 (file)
@@ -47,11 +47,12 @@ int write_packet(void *opaque, uint8_t *buf, int buf_size, AVIODataMarkerType ty
                type = AVIO_DATA_MARKER_SYNC_POINT;
        }
 
+       HTTPD::StreamID stream_id{ HTTPD::MAIN_STREAM, 0 };
        if (type == AVIO_DATA_MARKER_HEADER) {
                stream_mux_header.append((char *)buf, buf_size);
-               httpd->set_header(HTTPD::MAIN_STREAM, stream_mux_header);
+               httpd->set_header(stream_id, stream_mux_header);
        } else {
-               httpd->add_data(HTTPD::MAIN_STREAM, (char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT, time, AVRational{ AV_TIME_BASE, 1 });
+               httpd->add_data(stream_id, (char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT, time, AVRational{ AV_TIME_BASE, 1 });
        }
        return buf_size;
 }