浏览代码

plugins: Set keyframe flag on encoded audio packets

Not strictly necessary, and does not fix any bug. This just corrects a
nitpick that technically audio encoder packets are start points, but
that they aren't being labeled accordingly as keyframes.
tt2468 1 年之前
父节点
当前提交
8b6924b80f

+ 1 - 0
plugins/coreaudio-encoder/encoder.cpp

@@ -775,6 +775,7 @@ static bool aac_encode(void *data, struct encoder_frame *frame,
 	packet->timebase_num = 1;
 	packet->timebase_den = (uint32_t)ca->samples_per_second;
 	packet->type = OBS_ENCODER_AUDIO;
+	packet->keyframe = true;
 	packet->size = out_desc.mDataByteSize;
 	packet->data = (uint8_t *)buffer_list.mBuffers[0].mData +
 		       out_desc.mStartOffset;

+ 1 - 0
plugins/obs-ffmpeg/obs-ffmpeg-audio-encoders.c

@@ -442,6 +442,7 @@ static bool do_encode(struct enc_encoder *enc, struct encoder_packet *packet,
 	packet->data = enc->packet_buffer.array;
 	packet->size = avpacket.size;
 	packet->type = OBS_ENCODER_AUDIO;
+	packet->keyframe = true;
 	packet->timebase_num = 1;
 	packet->timebase_den = (int32_t)enc->context->sample_rate;
 	av_packet_unref(&avpacket);

+ 1 - 0
plugins/obs-libfdk/obs-libfdk.c

@@ -273,6 +273,7 @@ static bool libfdk_encode(void *data, struct encoder_frame *frame,
 	packet->data = enc->packet_buffer;
 	packet->size = out_args.numOutBytes;
 	packet->type = OBS_ENCODER_AUDIO;
+	packet->keyframe = true;
 	packet->timebase_num = 1;
 	packet->timebase_den = enc->sample_rate;