|
@@ -307,7 +307,7 @@ static int32_t last_time = 0;
|
|
|
|
|
|
static void flv_video(struct serializer *s, int32_t dts_offset, struct encoder_packet *packet, bool is_header)
|
|
static void flv_video(struct serializer *s, int32_t dts_offset, struct encoder_packet *packet, bool is_header)
|
|
{
|
|
{
|
|
- int64_t offset = packet->pts - packet->dts;
|
|
|
|
|
|
+ int32_t ct_offset_ms = get_ms_time(packet, packet->pts) - get_ms_time(packet, packet->dts);
|
|
int32_t time_ms = get_ms_time(packet, packet->dts) - dts_offset;
|
|
int32_t time_ms = get_ms_time(packet, packet->dts) - dts_offset;
|
|
|
|
|
|
if (!packet->data || !packet->size)
|
|
if (!packet->data || !packet->size)
|
|
@@ -332,7 +332,7 @@ static void flv_video(struct serializer *s, int32_t dts_offset, struct encoder_p
|
|
/* these are the 5 extra bytes mentioned above */
|
|
/* these are the 5 extra bytes mentioned above */
|
|
s_w8(s, packet->keyframe ? 0x17 : 0x27);
|
|
s_w8(s, packet->keyframe ? 0x17 : 0x27);
|
|
s_w8(s, is_header ? 0 : 1);
|
|
s_w8(s, is_header ? 0 : 1);
|
|
- s_wb24(s, get_ms_time(packet, offset));
|
|
|
|
|
|
+ s_wb24(s, ct_offset_ms);
|
|
s_write(s, packet->data, packet->size);
|
|
s_write(s, packet->data, packet->size);
|
|
|
|
|
|
write_previous_tag_size(s);
|
|
write_previous_tag_size(s);
|
|
@@ -486,7 +486,8 @@ void flv_packet_ex(struct encoder_packet *packet, enum video_id_t codec_id, int3
|
|
|
|
|
|
// H.264/HEVC composition time offset
|
|
// H.264/HEVC composition time offset
|
|
if ((codec_id == CODEC_H264 || codec_id == CODEC_HEVC) && type == PACKETTYPE_FRAMES) {
|
|
if ((codec_id == CODEC_H264 || codec_id == CODEC_HEVC) && type == PACKETTYPE_FRAMES) {
|
|
- s_wb24(&s, get_ms_time(packet, packet->pts - packet->dts));
|
|
|
|
|
|
+ int32_t ct_offset_ms = get_ms_time(packet, packet->pts) - get_ms_time(packet, packet->dts);
|
|
|
|
+ s_wb24(&s, ct_offset_ms);
|
|
}
|
|
}
|
|
|
|
|
|
// packet data
|
|
// packet data
|