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-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17875d97375838a99f2d0a2783762ebe86567b3f;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 d4422a3e3..0277db1b1 100644 --- a/src/muxer/muxer_audioes.c +++ b/src/muxer/muxer_audioes.c @@ -227,10 +227,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 bfdc683c5..5e8a1ff81 100644 --- a/src/muxer/muxer_mkv.c +++ b/src/muxer/muxer_mkv.c @@ -502,7 +502,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 c6a82b8ff..00763fdc7 100644 --- a/src/muxer/muxer_pass.c +++ b/src/muxer/muxer_pass.c @@ -435,10 +435,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; } }