|
|
|
@ -11,8 +11,6 @@
|
|
|
|
|
/** Downcast packet_sink to recorder */
|
|
|
|
|
#define DOWNCAST(SINK) container_of(SINK, struct sc_recorder, packet_sink)
|
|
|
|
|
|
|
|
|
|
#define SC_PTS_ORIGIN_NONE UINT64_C(-1)
|
|
|
|
|
|
|
|
|
|
static const AVRational SCRCPY_TIME_BASE = {1, 1000000}; // timestamps in us
|
|
|
|
|
|
|
|
|
|
static const AVOutputFormat *
|
|
|
|
@ -171,7 +169,7 @@ run_recorder(void *data) {
|
|
|
|
|
|
|
|
|
|
sc_mutex_unlock(&recorder->mutex);
|
|
|
|
|
|
|
|
|
|
if (recorder->pts_origin == SC_PTS_ORIGIN_NONE
|
|
|
|
|
if (recorder->pts_origin == AV_NOPTS_VALUE
|
|
|
|
|
&& rec->packet->pts != AV_NOPTS_VALUE) {
|
|
|
|
|
// First PTS received
|
|
|
|
|
recorder->pts_origin = rec->packet->pts;
|
|
|
|
@ -257,7 +255,7 @@ sc_recorder_open(struct sc_recorder *recorder, const AVCodec *input_codec) {
|
|
|
|
|
recorder->failed = false;
|
|
|
|
|
recorder->header_written = false;
|
|
|
|
|
recorder->previous = NULL;
|
|
|
|
|
recorder->pts_origin = SC_PTS_ORIGIN_NONE;
|
|
|
|
|
recorder->pts_origin = AV_NOPTS_VALUE;
|
|
|
|
|
|
|
|
|
|
const char *format_name = sc_recorder_get_format_name(recorder->format);
|
|
|
|
|
assert(format_name);
|
|
|
|
|