mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
Merge commit '9d64f236292ba28018dd9afd2d57f8f944b33f81'
* commit '9d64f236292ba28018dd9afd2d57f8f944b33f81': hls: Respect the different stream time bases when comparing dts Conflicts: libavformat/hls.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
65dcb54493
@ -705,21 +705,27 @@ start:
|
|||||||
/* Check if this stream still is on an earlier segment number, or
|
/* Check if this stream still is on an earlier segment number, or
|
||||||
* has the packet with the lowest dts */
|
* has the packet with the lowest dts */
|
||||||
if (var->pkt.data) {
|
if (var->pkt.data) {
|
||||||
if (minvariant < 0 ||
|
struct variant *minvar = c->variants[minvariant];
|
||||||
var->cur_seq_no < c->variants[minvariant]->cur_seq_no) {
|
if (minvariant < 0 || var->cur_seq_no < minvar->cur_seq_no) {
|
||||||
minvariant = i;
|
minvariant = i;
|
||||||
} else if (var->cur_seq_no == c->variants[minvariant]->cur_seq_no) {
|
} else if (var->cur_seq_no == minvar->cur_seq_no) {
|
||||||
struct variant *minvar = c->variants[minvariant];
|
int64_t dts = var->pkt.dts;
|
||||||
int64_t dts = var->pkt.dts;
|
int64_t mindts = minvar->pkt.dts;
|
||||||
int64_t mindts = minvar->pkt.dts;
|
AVStream *st = var->ctx->streams[var->pkt.stream_index];
|
||||||
AVStream *st = var->ctx->streams[ var->pkt.stream_index];
|
AVStream *minst = minvar->ctx->streams[minvar->pkt.stream_index];
|
||||||
AVStream *minst= minvar->ctx->streams[minvar->pkt.stream_index];
|
|
||||||
|
|
||||||
if( st->start_time != AV_NOPTS_VALUE) dts -= st->start_time;
|
if (dts == AV_NOPTS_VALUE) {
|
||||||
if(minst->start_time != AV_NOPTS_VALUE) mindts -= minst->start_time;
|
|
||||||
|
|
||||||
if (av_compare_ts(dts, st->time_base, mindts, minst->time_base) < 0)
|
|
||||||
minvariant = i;
|
minvariant = i;
|
||||||
|
} else if (mindts != AV_NOPTS_VALUE) {
|
||||||
|
if (st->start_time != AV_NOPTS_VALUE)
|
||||||
|
dts -= st->start_time;
|
||||||
|
if (minst->start_time != AV_NOPTS_VALUE)
|
||||||
|
mindts -= minst->start_time;
|
||||||
|
|
||||||
|
if (av_compare_ts(dts, st->time_base,
|
||||||
|
mindts, minst->time_base) < 0)
|
||||||
|
minvariant = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user