]> git.sesse.net Git - nageru/blobdiff - video_encoder.cpp
Rename ui_foo.ui to foo.ui; seemingly, it is more standard.
[nageru] / video_encoder.cpp
index efc9732c654093f4a00240039b5de55527382862..6344b8c6a04a89e0fe6e9e312999a2ad449ab93f 100644 (file)
@@ -34,7 +34,7 @@ string generate_local_dump_filename(int frame)
        tm now_tm;
        localtime_r(&now, &now_tm);
 
-       char timestamp[256];
+       char timestamp[64];
        strftime(timestamp, sizeof(timestamp), "%F-%T%z", &now_tm);
 
        // Use the frame number to disambiguate between two cuts starting
@@ -193,8 +193,7 @@ void VideoEncoder::open_output_stream()
                video_extradata = x264_encoder->get_global_headers();
        }
 
-       int time_base = global_flags.stream_coarse_timebase ? COARSE_TIMEBASE : TIMEBASE;
-       stream_mux.reset(new Mux(avctx, width, height, video_codec, video_extradata, stream_audio_encoder->get_codec_parameters().get(), time_base,
+       stream_mux.reset(new Mux(avctx, width, height, video_codec, video_extradata, stream_audio_encoder->get_codec_parameters().get(), COARSE_TIMEBASE,
                /*write_callback=*/nullptr, Mux::WRITE_FOREGROUND, { &stream_mux_metrics }));
        stream_mux_metrics.init({{ "destination", "http" }});
 }
@@ -219,7 +218,7 @@ int VideoEncoder::write_packet2(uint8_t *buf, int buf_size, AVIODataMarkerType t
                stream_mux_header.append((char *)buf, buf_size);
                httpd->set_header(stream_mux_header);
        } else {
-               httpd->add_data((char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT);
+               httpd->add_data((char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT, time, AVRational{ AV_TIME_BASE, 1 });
        }
        return buf_size;
 }