From: Jaroslav Kysela Date: Mon, 21 Aug 2017 11:43:15 +0000 (+0200) Subject: muxers: call muxer_cache_update only for seekable file descriptors X-Git-Tag: v4.2.4~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8a343b0a5e945ca2d83531881e14fb69bcae6cb;p=thirdparty%2Ftvheadend.git muxers: call muxer_cache_update only for seekable file descriptors --- diff --git a/src/muxer/muxer_audioes.c b/src/muxer/muxer_audioes.c index 79e3810d9..46f5d5b3a 100644 --- a/src/muxer/muxer_audioes.c +++ b/src/muxer/muxer_audioes.c @@ -228,10 +228,13 @@ audioes_muxer_write_pkt(muxer_t *m, streaming_message_type_t smt, void *data) am->m_eos = 1; } am->m_errors++; - muxer_cache_update(m, am->am_fd, am->am_off, 0); - am->am_off = lseek(am->am_fd, 0, SEEK_CUR); + if (am->am_seekable) { + muxer_cache_update(m, am->am_fd, am->am_off, 0); + am->am_off = lseek(am->am_fd, 0, SEEK_CUR); + } } else { - muxer_cache_update(m, am->am_fd, am->am_off, 0); + if (am->am_seekable) + muxer_cache_update(m, am->am_fd, am->am_off, 0); am->am_off += size; } diff --git a/src/muxer/muxer_mkv.c b/src/muxer/muxer_mkv.c index 2d3e53770..3bb4ed04b 100644 --- a/src/muxer/muxer_mkv.c +++ b/src/muxer/muxer_mkv.c @@ -490,7 +490,8 @@ mk_write_to_fd(mk_muxer_t *mk, htsbuf_queue_t *hq) iov += iovcnt; } while(i); - muxer_cache_update((muxer_t *)mk, mk->fd, oldpos, 0); + if (mk->seekable) + muxer_cache_update((muxer_t *)mk, mk->fd, oldpos, 0); return 0; } diff --git a/src/muxer/muxer_pass.c b/src/muxer/muxer_pass.c index c8c3c4efe..2bcc7eafd 100644 --- a/src/muxer/muxer_pass.c +++ b/src/muxer/muxer_pass.c @@ -420,10 +420,13 @@ pass_muxer_write(muxer_t *m, const void *data, size_t size) /* this is an end-of-streaming notification */ m->m_eos = 1; m->m_errors++; - muxer_cache_update(m, pm->pm_fd, pm->pm_off, 0); - pm->pm_off = lseek(pm->pm_fd, 0, SEEK_CUR); + if (pm->pm_seekable) { + muxer_cache_update(m, pm->pm_fd, pm->pm_off, 0); + pm->pm_off = lseek(pm->pm_fd, 0, SEEK_CUR); + } } else { - muxer_cache_update(m, pm->pm_fd, pm->pm_off, 0); + if (pm->pm_seekable) + muxer_cache_update(m, pm->pm_fd, pm->pm_off, 0); pm->pm_off += size; } }