summaryrefslogtreecommitdiff
path: root/xine_input_vdr.c
diff options
context:
space:
mode:
authorphintuka <phintuka>2008-04-10 20:21:45 +0000
committerphintuka <phintuka>2008-04-10 20:21:45 +0000
commit6a9c80a8ec8f8eb1ea1b3c66d259c6013b3e00bc (patch)
tree98611329531ee9cea27d02d13e6d4b27711abe25 /xine_input_vdr.c
parentdfd44f84954852ad0732dd66a0767d053a1fdeb1 (diff)
downloadxineliboutput-6a9c80a8ec8f8eb1ea1b3c66d259c6013b3e00bc.tar.gz
xineliboutput-6a9c80a8ec8f8eb1ea1b3c66d259c6013b3e00bc.tar.bz2
Deliver DISCARD control message in both streams (data and control).
(protect against random delays in control stream)
Diffstat (limited to 'xine_input_vdr.c')
-rw-r--r--xine_input_vdr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index 4fdb94bc..83826c9b 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.125 2008-03-25 21:58:01 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.126 2008-04-10 20:21:45 phintuka Exp $
*
*/
@@ -2476,6 +2476,7 @@ static void vdr_flush_engine(vdr_input_plugin_t *this)
_x_demux_control_start(this->stream);
#endif
this->stream_start = 1;
+ this->I_frames = this->B_frames = this->P_frames = 0;
resume_demuxer(this);
}
@@ -3553,10 +3554,13 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd)
} else if(!strncasecmp(cmd, "DISCARD ", 8)) {
if(2 == sscanf(cmd, "DISCARD %" PRIu64 " %d", &tmp64, &tmp32)) {
pthread_mutex_lock(&this->lock);
- this->discard_index = tmp64;
- this->discard_frame = tmp32;
- vdr_flush_engine(this);
- this->I_frames = this->B_frames = this->P_frames = 0;
+ if(this->discard_index < tmp64) {
+ this->discard_index = tmp64;
+ this->discard_frame = tmp32;
+ vdr_flush_engine(this);
+ } else if(this->discard_index != tmp64) {
+ LOGMSG("Ignoring delayed control message %s", cmd);
+ }
pthread_mutex_unlock(&this->lock);
} else
err = CONTROL_PARAM_ERROR;