mirror of https://git.ffmpeg.org/ffmpeg.git
ff_gen_search: Fix finding the maximum timestamp in a really small file
Fixes Assertion failure Found-by: durandal_1707 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
695a766bff
commit
6cd650dbd2
|
@ -1863,10 +1863,10 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
|
|||
filesize = avio_size(s->pb);
|
||||
pos_max = filesize - 1;
|
||||
do{
|
||||
pos_max -= step;
|
||||
pos_max = FFMAX(0, pos_max - step);
|
||||
ts_max = ff_read_timestamp(s, stream_index, &pos_max, pos_max + step, read_timestamp);
|
||||
step += step;
|
||||
}while(ts_max == AV_NOPTS_VALUE && pos_max >= step);
|
||||
}while(ts_max == AV_NOPTS_VALUE && pos_max > 0);
|
||||
if (ts_max == AV_NOPTS_VALUE)
|
||||
return -1;
|
||||
|
||||
|
|
|
@ -1,35 +1,53 @@
|
|||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:0 ts:-1.000000
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret:-1 st:-1 flags:1 ts: 1.894167
|
||||
ret:-1 st: 0 flags:0 ts: 0.788345
|
||||
ret: 0 st:-1 flags:1 ts: 1.894167
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:0 ts: 0.788345
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:1 ts:-0.317506
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret:-1 st:-1 flags:0 ts: 2.576668
|
||||
ret:-1 st:-1 flags:1 ts: 1.470835
|
||||
ret:-1 st: 0 flags:0 ts: 0.365011
|
||||
ret: 0 st:-1 flags:0 ts: 2.576668
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:1 ts: 1.470835
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:0 ts: 0.365011
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:1 ts:-0.740839
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret:-1 st:-1 flags:0 ts: 2.153336
|
||||
ret:-1 st:-1 flags:1 ts: 1.047503
|
||||
ret: 0 st:-1 flags:0 ts: 2.153336
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:1 ts: 1.047503
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:0 ts:-0.058322
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret:-1 st: 0 flags:1 ts: 2.835828
|
||||
ret:-1 st:-1 flags:0 ts: 1.730004
|
||||
ret:-1 st:-1 flags:1 ts: 0.624171
|
||||
ret: 0 st: 0 flags:1 ts: 2.835828
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:0 ts: 1.730004
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:1 ts: 0.624171
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:0 ts:-0.481655
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret:-1 st: 0 flags:1 ts: 2.412494
|
||||
ret:-1 st:-1 flags:0 ts: 1.306672
|
||||
ret:-1 st:-1 flags:1 ts: 0.200839
|
||||
ret: 0 st: 0 flags:1 ts: 2.412494
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:0 ts: 1.306672
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:1 ts: 0.200839
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:0 ts:-0.904989
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret:-1 st: 0 flags:1 ts: 1.989184
|
||||
ret:-1 st:-1 flags:0 ts: 0.883340
|
||||
ret: 0 st: 0 flags:1 ts: 1.989184
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:0 ts: 0.883340
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:1 ts:-0.222493
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret:-1 st: 0 flags:0 ts: 2.671678
|
||||
ret:-1 st: 0 flags:1 ts: 1.565850
|
||||
ret:-1 st:-1 flags:0 ts: 0.460008
|
||||
ret: 0 st: 0 flags:0 ts: 2.671678
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st: 0 flags:1 ts: 1.565850
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:0 ts: 0.460008
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
ret: 0 st:-1 flags:1 ts:-0.645825
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 143 size: 1364
|
||||
|
|
Loading…
Reference in New Issue