Skip to content

Commit

Permalink
fix: handle negative timestamp
Browse files Browse the repository at this point in the history
The previous behavior caused an ambigious state in read_av_packet when the stream started with multiple packets with negative pts
  • Loading branch information
bartadaniel committed Oct 25, 2024
1 parent fc692b3 commit c2f6844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/web-demuxer/web_demuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void gen_web_packet(WebAVPacket &web_packet, AVPacket *packet, AVStream *stream)
double packet_timestamp = packet->pts * av_q2d(stream->time_base);

web_packet.keyframe = packet->flags & AV_PKT_FLAG_KEY;
web_packet.timestamp = packet_timestamp > 0 ? packet_timestamp : 0;
web_packet.timestamp = packet_timestamp;
web_packet.duration = packet->duration * av_q2d(stream->time_base);
web_packet.size = packet->size;
if (packet->size > 0)
Expand Down

0 comments on commit c2f6844

Please sign in to comment.