diff options
author | phintuka <phintuka> | 2010-03-21 10:26:47 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2010-03-21 10:26:47 +0000 |
commit | 6bcd680785dba940686cedd4a029062c4f64939f (patch) | |
tree | ce16388128c9989dc37398b9819c413d0e5b9e76 | |
parent | b2a67cdf7f4cb4b748927cc05ab62d1d8390fe3d (diff) | |
download | xineliboutput-6bcd680785dba940686cedd4a029062c4f64939f.tar.gz xineliboutput-6bcd680785dba940686cedd4a029062c4f64939f.tar.bz2 |
wire()/unwire(): safety checks (stream, stream->metronom)
-rw-r--r-- | xine/xvdr_metronom.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/xine/xvdr_metronom.c b/xine/xvdr_metronom.c index 506f965c..34cc7683 100644 --- a/xine/xvdr_metronom.c +++ b/xine/xvdr_metronom.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xvdr_metronom.c,v 1.8 2010-03-21 09:54:21 phintuka Exp $ + * $Id: xvdr_metronom.c,v 1.9 2010-03-21 10:26:47 phintuka Exp $ * */ @@ -174,17 +174,27 @@ static void xvdr_metronom_set_still_mode(xvdr_metronom_t *this, int still_mode) static void xvdr_metronom_wire(xvdr_metronom_t *this) { + if (!this->stream) { + LOGMSG("xvdr_metronom_wire(): stream == NULL !"); + return; + } + if (!this->stream->metronom) { + LOGMSG("xvdr_metronom_wire(): stream->metronom == NULL !"); + return; + } + if (!this->wired) { this->wired = 1; /* attach to stream */ + this->orig_metronom = this->stream->metronom; this->stream->metronom = &this->metronom; } } static void xvdr_metronom_unwire(xvdr_metronom_t *this) { - if (this->wired) { + if (this->stream && this->wired) { this->wired = 0; /* detach from stream */ |