diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 97bd74a..07a5ea2 100644
|
a
|
b
|
typedef struct AppleHTTPContext {
|
| 99 | 99 | int cur_seq_no; |
| 100 | 100 | int end_of_segment; |
| 101 | 101 | int first_packet; |
| | 102 | int64_t first_timestamp; |
| 102 | 103 | AVIOInterruptCB *interrupt_callback; |
| 103 | 104 | } AppleHTTPContext; |
| 104 | 105 | |
| … |
… |
static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
| 527 | 528 | } |
| 528 | 529 | |
| 529 | 530 | c->first_packet = 1; |
| | 531 | c->first_timestamp = -1; |
| 530 | 532 | |
| 531 | 533 | return 0; |
| 532 | 534 | fail: |
| … |
… |
start:
|
| 591 | 593 | if (!url_feof(&var->pb)) |
| 592 | 594 | return ret; |
| 593 | 595 | reset_packet(&var->pkt); |
| | 596 | } else { |
| | 597 | if (c->first_timestamp == -1) |
| | 598 | c->first_timestamp = var->pkt.dts; |
| 594 | 599 | } |
| 595 | 600 | } |
| 596 | 601 | /* Check if this stream has the packet with the lowest dts */ |
| … |
… |
static int applehttp_read_seek(AVFormatContext *s, int stream_index,
|
| 639 | 644 | for (i = 0; i < c->n_variants; i++) { |
| 640 | 645 | /* Reset reading */ |
| 641 | 646 | struct variant *var = c->variants[i]; |
| 642 | | int64_t pos = 0; |
| 643 | | if (var->input) { |
| | 647 | int64_t pos = av_rescale_rnd(c->first_timestamp, 1, stream_index >= 0 ? |
| | 648 | s->streams[stream_index]->time_base.den : |
| | 649 | AV_TIME_BASE, flags & AVSEEK_FLAG_BACKWARD ? |
| | 650 | AV_ROUND_DOWN : AV_ROUND_UP); |
| | 651 | if (var->input) { |
| 644 | 652 | ffurl_close(var->input); |
| 645 | 653 | var->input = NULL; |
| 646 | 654 | } |