]> 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>
Thu, 31 Aug 2017 13:57:01 +0000 (15:57 +0200)
src/muxer/muxer_audioes.c
src/muxer/muxer_mkv.c
src/muxer/muxer_pass.c

index 79e3810d988c37c73609f0f1598453bfc3df731a..46f5d5b3a357d258a29396a4230096cced2c4bc5 100644 (file)
@@ -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;
   }
 
index 2d3e5377091c4eae01c89f70f7b7729ddcbea725..3bb4ed04b58bb6a95af0820f994143d2cd6e723f 100644 (file)
@@ -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;
 }
index c8c3c4efe1784fb30dc882f8175ecbbcd96d8fc3..2bcc7eafd4341139a8f38215cff5a8e567d2e6bf 100644 (file)
@@ -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;
   }
 }