Message ID | CAKVPjOayTYJ4xn05Nii=aduW-SL6zTKNQteSdcKGep7T1v5WPA@mail.gmail.com |
---|---|
State | Not Applicable |
Headers | show |
Le quartidi 14 prairial, an CCXXV, Daniel Kučera a écrit : > Now I'm trying to pass fate. I've fixed some problems but don't have > an idea why it won't pass following test. Does anyone have idea? I suspect you need to fix lavf/file.c to actually return AVERROR_EOF. Regards,
2017-06-02 15:02 GMT+02:00 Nicolas George <george@nsup.org>: > Le quartidi 14 prairial, an CCXXV, Daniel Kučera a écrit : >> Now I'm trying to pass fate. I've fixed some problems but don't have >> an idea why it won't pass following test. Does anyone have idea? > > I suspect you need to fix lavf/file.c to actually return AVERROR_EOF. > I already did: +++ b/libavformat/file.c @@ -112,6 +112,8 @@ static int file_read(URLContext *h, unsigned char *buf, int size) ret = read(c->fd, buf, size); if (ret == 0 && c->follow) return AVERROR(EAGAIN); + if (ret == 0) + return AVERROR_EOF; return (ret == -1) ? AVERROR(errno) : ret; } S pozdravom / Best regards Daniel Kucera.
2017-06-02 15:08 GMT+02:00 Daniel Kučera <daniel.kucera@gmail.com>: > 2017-06-02 15:02 GMT+02:00 Nicolas George <george@nsup.org>: >> Le quartidi 14 prairial, an CCXXV, Daniel Kučera a écrit : >>> Now I'm trying to pass fate. I've fixed some problems but don't have >>> an idea why it won't pass following test. Does anyone have idea? >> >> I suspect you need to fix lavf/file.c to actually return AVERROR_EOF. >> problem is that cache_seek is calling ffurl_seek, but h->prot->url_seek is zero so it returns AVERROR(ENOSYS) I'm little bit lost... Breakpoint 3, cache_seek (h=0x555556ea08e0, pos=0, whence=65536) at libavformat/cache.c:222 222 { (gdb) break ffurl_seek Note: breakpoint 2 also set at pc 0x55555577ccd0. Breakpoint 4 at 0x55555577ccd0: file libavformat/avio.c, line 438. (gdb) c Continuing. Breakpoint 2, ffurl_seek (h=0x555556ea0aa0, pos=0, whence=65536) at libavformat/avio.c:438 438 if (!h->prot->url_seek) (gdb) p h->prot->url_seek $2 = (int64_t (*)(URLContext *, int64_t, int)) 0x0 S pozdravom / Best regards Daniel Kucera.
2017-06-02 15:43 GMT+02:00 Daniel Kučera <daniel.kucera@gmail.com>: > 2017-06-02 15:08 GMT+02:00 Daniel Kučera <daniel.kucera@gmail.com>: >> 2017-06-02 15:02 GMT+02:00 Nicolas George <george@nsup.org>: >>> Le quartidi 14 prairial, an CCXXV, Daniel Kučera a écrit : >>>> Now I'm trying to pass fate. I've fixed some problems but don't have >>>> an idea why it won't pass following test. Does anyone have idea? >>> >>> I suspect you need to fix lavf/file.c to actually return AVERROR_EOF. >>> > > problem is that cache_seek is calling ffurl_seek, but > h->prot->url_seek is zero so it returns AVERROR(ENOSYS) > > I'm little bit lost... > Ok, I've found it and successfully passed fate. I'll send updated patch in separate e-mail. S pozdravom / Best regards Daniel Kucera.
--- ./tests/ref/seek/cache-pipe 2017-05-23 17:02:08.517401755 +0200 +++ tests/data/fate/seek-cache-pipe 2017-06-02 14:30:41.555138153 +0200 @@ -6,21 +6,19 @@ ret: 0 st: 0 flags:0 ts: 0.788334 ret: 0 st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos: 14407 size: 418 ret:-1 st: 0 flags:1 ts:-0.317499 -ret: 0 st:-1 flags:0 ts: 2.576668 -ret: 0 st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos: 42828 size: 418 +ret:-1 st:-1 flags:0 ts: 2.576668 ret: 0 st:-1 flags:1 ts: 1.470835 ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 24856 size: 418 ret: 0 st: 0 flags:0 ts: 0.365002 ret: 0 st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos: 7302 size: 418 ret:-1 st: 0 flags:1 ts:-0.740831 -ret: 0 st:-1 flags:0 ts: 2.153336 -ret: 0 st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos: 36141 size: 418 +ret:-1 st:-1 flags:0 ts: 2.153336 ret: 0 st:-1 flags:1 ts: 1.047503 ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 18169 size: 418 ret: 0 st: 0 flags:0 ts:-0.058330