diff options
author | Simon Farnsworth <simon.farnsworth@onelan.co.uk> | 2007-05-02 17:31:11 +0100 |
---|---|---|
committer | Simon Farnsworth <simon.farnsworth@onelan.co.uk> | 2007-05-02 17:31:11 +0100 |
commit | f7bd2c6ee4e3f066248e087cbf5f97a21103ebd1 (patch) | |
tree | ac0845fcae655312f4b16869da30562be7ed9c61 /src | |
parent | 84133d2fad4c392de75d41d88a19850734ea5523 (diff) | |
download | xine-lib-f7bd2c6ee4e3f066248e087cbf5f97a21103ebd1.tar.gz xine-lib-f7bd2c6ee4e3f066248e087cbf5f97a21103ebd1.tar.bz2 |
[PATCH] Remove packet count from demux_ts, to remove a long delay
The attached patch applies after my logging patches (I can regenerate if
needed).
demux_ts attempted to read packets from the input 200 times before
giving up. When playing a local file, this is harmless, as it will hit
EOF 200 times; however, input_dvb waits 5 seconds for packets on each
call to read, resulting in a 1000 second delay if tuning fails.
Remove the counting of input packets, and add a comment to read() in
input_plugin.h, to indicate that we expect inputs to try and return some
data when read() is called. This fixes the delay, and makes it clear to
future maintainers that they shouldn't expect to loop like this.
--
Simon Farnsworth
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_ts.c | 8 | ||||
-rw-r--r-- | src/input/input_plugin.h | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index c57fc34ef..f2da5f268 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -337,7 +337,6 @@ typedef struct { int32_t packet_number; /* NEW: var to keep track of number of last read packets */ int32_t npkt_read; - int32_t read_zero; uint8_t buf[BUF_SIZE]; /* == PKT_SIZE * NPKT_PER_READ */ @@ -1536,12 +1535,7 @@ static unsigned char * demux_synchronise(demux_ts_t* this) { */ if (this->npkt_read == 0) { - /* printf ("demux_ts: read 0 packets! (%d)\n", this->read_zero); */ - this->read_zero++; - } else this->read_zero = 0; - - if (this->read_zero > 200) { - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts: read 0 packets too many times!\n"); + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts: read 0 packets\n"); this->status = DEMUX_FINISHED; return NULL; } diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h index 370dc6a71..11e1303e7 100644 --- a/src/input/input_plugin.h +++ b/src/input/input_plugin.h @@ -115,6 +115,8 @@ struct input_plugin_s { /* * read nlen bytes, return number of bytes read + * Should block until some bytes available for read; + * a return value of 0 indicates no data available */ off_t (*read) (input_plugin_t *this, char *buf, off_t nlen); |