Commit ea1a53f
committed
fix: rescale format context duration to stream time base
The duration fallback for streams with unknown duration assigned
AVFormatContext::duration, which is measured in AV_TIME_BASE units
(1/1e6 s), directly to AVStream::duration, which is measured in
stream time_base units. For webm/mkv streams with a 1/1000 s time
base this inflated the frame index range by ~1000x, breaking
seeking and the waveform/spectrogram (e.g. "Stream ends at sample
frame 18534900 instead of 18535728336"). Rescale the duration
with av_rescale_q before assigning it.1 parent 968015e commit ea1a53f
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
753 | 762 | | |
754 | 763 | | |
755 | 764 | | |
| |||
0 commit comments