Browse Source

obs-outputs: Do not drop I-frames

When frames were dropped, it would also drop I-frames, which can mess
with the keyframe calculation of certain services that depend on
I-frames in their output protocol (such as HLS).
jp9000 10 years ago
parent
commit
0e2a5d2de2
1 changed files with 3 additions and 1 deletions
  1. 3 1
      plugins/obs-outputs/rtmp-stream.c

+ 3 - 1
plugins/obs-outputs/rtmp-stream.c

@@ -508,7 +508,9 @@ static void drop_frames(struct rtmp_stream *stream)
 
 		last_drop_dts_usec = packet.dts_usec;
 
-		if (packet.type == OBS_ENCODER_AUDIO) {
+		/* do not drop audio data or video keyframes */
+		if (packet.type          == OBS_ENCODER_AUDIO ||
+		    packet.drop_priority == OBS_NAL_PRIORITY_HIGHEST) {
 			circlebuf_push_back(&new_buf, &packet, sizeof(packet));
 
 		} else {