mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
[transcode] Make sure transcode_seek() only returns negative on error
- newer ffmpeg seems to give timestamps that give negative got_pts when seeking to 0
This commit is contained in:
parent
1748430c48
commit
3bb6220ce9
@ -1788,6 +1788,10 @@ transcode_seek(struct transcode_ctx *ctx, int ms)
|
||||
got_pts = av_rescale_q(got_pts, in_stream->time_base, AV_TIME_BASE_Q);
|
||||
got_ms = got_pts / (AV_TIME_BASE / 1000);
|
||||
|
||||
// Since negative return would mean error, we disallow it here
|
||||
if (got_ms < 0)
|
||||
got_ms = 0;
|
||||
|
||||
DPRINTF(E_DBG, L_XCODE, "Seek wanted %d ms, got %d ms\n", ms, got_ms);
|
||||
|
||||
return got_ms;
|
||||
|
Loading…
Reference in New Issue
Block a user