muxers: do not show EPIPE as an error
This commit is contained in:
parent
2bdff4c0ec
commit
2aaf9a4ef1
5 changed files with 14 additions and 7 deletions
|
@ -81,6 +81,7 @@ typedef struct muxer {
|
|||
void *);
|
||||
int (*m_add_marker) (struct muxer *); // Add a marker (or chapter)
|
||||
|
||||
int m_eos; // End of stream
|
||||
int m_errors; // Number of errors
|
||||
muxer_container_type_t m_container; // The type of the container
|
||||
muxer_config_t m_config; // general configuration
|
||||
|
|
|
@ -401,10 +401,12 @@ pass_muxer_write(muxer_t *m, const void *data, size_t size)
|
|||
pm->m_errors++;
|
||||
} else if(tvh_write(pm->pm_fd, data, size)) {
|
||||
pm->pm_error = errno;
|
||||
if (errno == EPIPE) /* this is an end-of-streaming notification */
|
||||
return;
|
||||
tvhlog(LOG_ERR, "pass", "%s: Write failed -- %s", pm->pm_filename,
|
||||
strerror(errno));
|
||||
if (errno != EPIPE)
|
||||
tvhlog(LOG_ERR, "pass", "%s: Write failed -- %s", pm->pm_filename,
|
||||
strerror(errno));
|
||||
else
|
||||
/* 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);
|
||||
|
|
|
@ -155,10 +155,13 @@ tvh_muxer_write_pkt(muxer_t *m, streaming_message_type_t smt, void *data)
|
|||
{
|
||||
th_pkt_t *pkt = (th_pkt_t*)data;
|
||||
tvh_muxer_t *tm = (tvh_muxer_t*)m;
|
||||
int r;
|
||||
|
||||
assert(smt == SMT_PACKET);
|
||||
|
||||
if(mk_mux_write_pkt(tm->tm_ref, pkt)) {
|
||||
if((r = mk_mux_write_pkt(tm->tm_ref, pkt)) != 0) {
|
||||
if (r == EPIPE)
|
||||
tm->m_eos = 1;
|
||||
tm->m_errors++;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -462,7 +462,7 @@ mk_write_to_fd(mk_mux_t *mkm, htsbuf_queue_t *hq)
|
|||
static void
|
||||
mk_write_queue(mk_mux_t *mkm, htsbuf_queue_t *q)
|
||||
{
|
||||
if(!mkm->error && mk_write_to_fd(mkm, q))
|
||||
if(!mkm->error && mk_write_to_fd(mkm, q) && mkm->error != EPIPE)
|
||||
tvhlog(LOG_ERR, "mkv", "%s: Write failed -- %s", mkm->filename,
|
||||
strerror(errno));
|
||||
|
||||
|
|
|
@ -339,7 +339,8 @@ http_stream_run(http_connection_t *hc, streaming_queue_t *sq,
|
|||
streaming_msg_free(sm);
|
||||
|
||||
if(mux->m_errors) {
|
||||
tvhlog(LOG_WARNING, "webui", "Stop streaming %s, muxer reported errors", hc->hc_url_orig);
|
||||
if (!mux->m_eos)
|
||||
tvhlog(LOG_WARNING, "webui", "Stop streaming %s, muxer reported errors", hc->hc_url_orig);
|
||||
run = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue