]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
muxers: call muxer_cache_update only for seekable file descriptors
authorJaroslav Kysela <perex@perex.cz>
Mon, 21 Aug 2017 11:43:15 +0000 (13:43 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 22 Aug 2017 08:14:58 +0000 (10:14 +0200)
src/muxer/muxer_audioes.c
src/muxer/muxer_mkv.c
src/muxer/muxer_pass.c

index d4422a3e358b695cd1fe5ba11447ee1eb18fdc2b..0277db1b1ad766c11666452ec5684a9010cfb978 100644 (file)
@@ -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;
   }
 
index bfdc683c5ace3bfa60ac2faa6f278d91007bc0a8..5e8a1ff81ce4410c74d33fc2155c7d57b2da5477 100644 (file)
@@ -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;
 }
index c6a82b8ff4561ef134a8682162a5be2ea2512f5f..00763fdc752caa1e9b43b38778b70b1fc4487cf0 100644 (file)
@@ -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;
   }
 }