diff --git a/src/driver/record.cpp b/src/driver/record.cpp index fa34c0892..3f58b5ac2 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2472,14 +2472,14 @@ void CStreamRec::run() pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); - av_write_frame(ofcx, &pkt); - av_packet_unref(&pkt); - if (pkt.stream_index == stream_index) { total += (double) 1000 * pkt.duration * av_q2d(ifcx->streams[stream_index]->time_base); //printf("PKT: duration %d (%f) total %f (ifcx->duration %016llx\n", pkt.duration, duration, total, ifcx->duration); } + av_write_frame(ofcx, &pkt); + av_packet_unref(&pkt); + if (now == 0) WriteHeader(1000); now = time_monotonic();