If we try to write a packet with dts == AV_NOPTS_VALUE, set it to stream->cur_dts. This might at least give us a playable file.
This commit is contained in:
parent
3b586a2abe
commit
90d6e11fb9
|
@ -996,6 +996,11 @@ int VideoStore::write_packet(AVPacket *pkt, AVStream *stream) {
|
|||
pkt->pos = -1;
|
||||
pkt->stream_index = stream->index;
|
||||
|
||||
if ( pkt->dts == AV_NOPTS_VALUE ) {
|
||||
Debug(1, "undef dts, fixing by setting to stream cur_dts %" PRId64, stream->cur_dts);
|
||||
pkt->dts = stream->cur_dts;
|
||||
}
|
||||
|
||||
if ( pkt->dts < stream->cur_dts ) {
|
||||
Debug(1, "non increasing dts, fixing. our dts %" PRId64 " stream cur_dts %" PRId64, pkt->dts, stream->cur_dts);
|
||||
pkt->dts = stream->cur_dts;
|
||||
|
|
Loading…
Reference in New Issue