Fix incorrect assertion in recording

It was assumed that the video packet immediately following a config
packet was a non-config packet. This is not necessarily true: for
example, if the capture is reset (due to resizing or rotation) before
the first frame is produced.
This commit is contained in:
Romain Vimont 2026-04-11 13:42:36 +02:00
parent f669c81b94
commit fd6536b34a

View file

@ -362,13 +362,12 @@ sc_recorder_process_packets(struct sc_recorder *recorder) {
}
if (pts_origin == AV_NOPTS_VALUE) {
if (!recorder->audio) {
assert(video_pkt);
if (!recorder->audio && video_pkt) {
pts_origin = video_pkt->pts;
} else if (!recorder->video) {
assert(audio_pkt);
} else if (!recorder->video && audio_pkt) {
pts_origin = audio_pkt->pts;
} else if (video_pkt && audio_pkt) {
} else if (recorder->video && recorder->audio && video_pkt
&& audio_pkt) {
pts_origin = MIN(video_pkt->pts, audio_pkt->pts);
} else if (recorder->stopped) {
if (video_pkt) {