mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
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:
parent
f669c81b94
commit
fd6536b34a
1 changed files with 4 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue