summaryrefslogtreecommitdiff
path: root/src/post/visualizations/fftgraph.c
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2004-05-29 14:45:25 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2004-05-29 14:45:25 +0000
commita74413f06efef91496b3f5b9f749b328ede19ac8 (patch)
tree4077995d8ad8c0fc3784d9c7d91a40e1b15e731c /src/post/visualizations/fftgraph.c
parentcd2b6b26d53a8d879250cd28f0dfbb1cf2b04355 (diff)
downloadxine-lib-a74413f06efef91496b3f5b9f749b328ede19ac8.tar.gz
xine-lib-a74413f06efef91496b3f5b9f749b328ede19ac8.tar.bz2
separate the two semantics of querying a port's status with a NULL stream;
before, NULL could mean two things: no stream at all or a stream that does not want to be addressed; now the latter is represented by the new XINE_ANON_STREAM resulting changes: * the status() functions now behave differently for NULL and XINE_ANON_STREAM (as the commentary always implied, but this was not the case, so post plugin rewiring went wrong, because it relies on the status() function) * the NULL_STREAM defines in audio_out and video_out are obsolete * update the function comments in the headers * update the post plugin rewire functions to use the status() functions to check, if the old port was opened and handle the new one accordingly; this makes open_count obsolete * change all post plugins accordingly (mostly using XINE_ANON_STREAM instead of NULL) additional change: * the status() function of audio port now returns the bits/rate/mode values of the input and not the output; this is more likely to be what a post plugin wants * the reimplementation of status() in the upmix plugin is obsolete CVS patchset: 6603 CVS date: 2004/05/29 14:45:25
Diffstat (limited to 'src/post/visualizations/fftgraph.c')
-rw-r--r--src/post/visualizations/fftgraph.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c
index eeb0f246e..1b88b4521 100644
--- a/src/post/visualizations/fftgraph.c
+++ b/src/post/visualizations/fftgraph.c
@@ -20,7 +20,7 @@
* FftGraph Visualization Post Plugin For xine
* by Thibaut Mattern (tmattern@noos.fr)
*
- * $Id: fftgraph.c,v 1.11 2004/05/18 03:17:03 miguelfreitas Exp $
+ * $Id: fftgraph.c,v 1.12 2004/05/29 14:45:26 mroi Exp $
*
*/
@@ -196,8 +196,8 @@ static int fftgraph_rewire_video(xine_post_out_t *output_gen, void *data)
if (!data)
return 0;
/* register our stream at the new output port */
- old_port->close(old_port, NULL);
- new_port->open(new_port, NULL);
+ old_port->close(old_port, XINE_ANON_STREAM);
+ new_port->open(new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -217,14 +217,10 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
- if (stream)
- port->stream = stream;
- else
- port->stream = POST_NULL_STREAM;
+ port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
- port->open_count++;
this->ratio = (double)FFTGRAPH_WIDTH / (double)FFTGRAPH_HEIGHT;
@@ -235,7 +231,7 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
this->samples_per_frame = rate / FPS;
this->data_idx = 0;
- this->vo_port->open(this->vo_port, NULL);
+ this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
this->fft = fft_new(FFT_BITS);
@@ -300,13 +296,11 @@ static void fftgraph_port_close(xine_audio_port_t *port_gen, xine_stream_t *stre
fft_dispose(this->fft);
this->fft = NULL;
- this->vo_port->close(this->vo_port, NULL);
+ this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
port->original_port->close(port->original_port, stream );
- port->open_count--;
-
_x_post_dec_usage(port);
}
@@ -387,7 +381,7 @@ static void fftgraph_port_put_buffer (xine_audio_port_t *port_gen,
draw_fftgraph(this, frame);
- frame->draw(frame, NULL);
+ frame->draw(frame, XINE_ANON_STREAM);
frame->free(frame);
}
} while( this->sample_counter >= this->samples_per_frame );