obs-ffmpeg: Don't purge packets when there are none
This commit is contained in:
parent
6942bb814d
commit
62d0661f98
@ -724,6 +724,9 @@ static bool purge_front(struct ffmpeg_muxer *stream)
|
||||
struct encoder_packet pkt;
|
||||
bool keyframe;
|
||||
|
||||
if (!stream->packets.size)
|
||||
return false;
|
||||
|
||||
circlebuf_pop_front(&stream->packets, &pkt, sizeof(pkt));
|
||||
|
||||
keyframe = pkt.type == OBS_ENCODER_VIDEO && pkt.keyframe;
|
||||
@ -751,6 +754,8 @@ static inline void purge(struct ffmpeg_muxer *stream)
|
||||
struct encoder_packet pkt;
|
||||
|
||||
for (;;) {
|
||||
if (!stream->packets.size)
|
||||
return;
|
||||
circlebuf_peek_front(&stream->packets, &pkt,
|
||||
sizeof(pkt));
|
||||
if (pkt.type == OBS_ENCODER_VIDEO && pkt.keyframe)
|
||||
|
Loading…
x
Reference in New Issue
Block a user