summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-11-15 13:01:00 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-11-15 13:01:00 +0000
commit570fd9006dcf6f9aaa460e79b93b7ce37f7c6d7b (patch)
treeed387d71185404d03367e64a52093b0e6369ed67 /src/input
parentbb62a769e4a50cef3023408bf9a527e63b7d884d (diff)
downloadxine-lib-570fd9006dcf6f9aaa460e79b93b7ce37f7c6d7b.tar.gz
xine-lib-570fd9006dcf6f9aaa460e79b93b7ce37f7c6d7b.tar.bz2
more helper functions cleanup (stream info, meta info)
CVS patchset: 5731 CVS date: 2003/11/15 13:01:00
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_cdda.c22
-rw-r--r--src/input/input_dvd.c7
-rw-r--r--src/input/input_http.c4
-rw-r--r--src/input/input_pvr.c6
-rw-r--r--src/input/net_buf_ctrl.c16
-rw-r--r--src/input/vcd/xineplug_inp_vcd.c16
6 files changed, 27 insertions, 44 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index f24950896..b98659819 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -20,7 +20,7 @@
* Compact Disc Digital Audio (CDDA) Input Plugin
* by Mike Melanson (melanson@pcisys.net)
*
- * $Id: input_cdda.c,v 1.36 2003/10/31 17:28:05 mroi Exp $
+ * $Id: input_cdda.c,v 1.37 2003/11/15 13:01:04 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -2406,9 +2406,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
printf("Disc Title: %s\n", this->cddb.disc_title);
#endif
- if(this->stream->meta_info[XINE_META_INFO_ALBUM])
- free(this->stream->meta_info[XINE_META_INFO_ALBUM]);
- this->stream->meta_info[XINE_META_INFO_ALBUM] = strdup(this->cddb.disc_title);
+ xine_set_meta_info(this->stream, XINE_META_INFO_ALBUM, this->cddb.disc_title);
}
if(this->cddb.track[this->track].title) {
@@ -2416,9 +2414,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
printf("Track %d Title: %s\n", this->track+1, this->cddb.track[this->track].title);
#endif
- if(this->stream->meta_info[XINE_META_INFO_TITLE])
- free(this->stream->meta_info[XINE_META_INFO_TITLE]);
- this->stream->meta_info[XINE_META_INFO_TITLE] = strdup(this->cddb.track[this->track].title);
+ xine_set_meta_info(this->stream, XINE_META_INFO_TITLE, this->cddb.track[this->track].title);
}
if(this->cddb.disc_artist) {
@@ -2426,9 +2422,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
printf("Disc Artist: %s\n", this->cddb.disc_artist);
#endif
- if(this->stream->meta_info[XINE_META_INFO_ARTIST])
- free(this->stream->meta_info[XINE_META_INFO_ARTIST]);
- this->stream->meta_info[XINE_META_INFO_ARTIST] = strdup(this->cddb.disc_artist);
+ xine_set_meta_info(this->stream, XINE_META_INFO_ARTIST, this->cddb.disc_artist);
}
if(this->cddb.disc_category) {
@@ -2436,9 +2430,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
printf("Disc Category: %s\n", this->cddb.disc_category);
#endif
- if(this->stream->meta_info[XINE_META_INFO_GENRE])
- free(this->stream->meta_info[XINE_META_INFO_GENRE]);
- this->stream->meta_info[XINE_META_INFO_GENRE] = strdup(this->cddb.disc_category);
+ xine_set_meta_info(this->stream, XINE_META_INFO_GENRE, this->cddb.disc_category);
}
if(this->cddb.disc_year) {
@@ -2446,9 +2438,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
printf("Disc Year: %s\n", this->cddb.disc_year);
#endif
- if(this->stream->meta_info[XINE_META_INFO_YEAR])
- free(this->stream->meta_info[XINE_META_INFO_YEAR]);
- this->stream->meta_info[XINE_META_INFO_YEAR] = strdup(this->cddb.disc_year);
+ xine_set_meta_info(this->stream, XINE_META_INFO_YEAR, this->cddb.disc_year);
}
free_cdrom_toc(toc);
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index dff92f57f..792575fd8 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.171 2003/11/11 18:44:53 f1rmb Exp $
+ * $Id: input_dvd.c,v 1.172 2003/11/15 13:01:07 miguelfreitas Exp $
*
*/
@@ -861,7 +861,7 @@ static void xine_dvd_send_button_update(dvd_input_plugin_t *this, int mode) {
int32_t button;
int32_t show;
- if (!this || !this->stream || this->stream->stream_info[XINE_STREAM_INFO_IGNORE_SPU])
+ if (!this || !this->stream || xine_get_stream_info(this->stream,XINE_STREAM_INFO_IGNORE_SPU))
return;
if (!this->stream->spu_decoder_plugin ||
@@ -1727,6 +1727,9 @@ static void *init_class (xine_t *xine, void *data) {
/*
* $Log: input_dvd.c,v $
+ * Revision 1.172 2003/11/15 13:01:07 miguelfreitas
+ * more helper functions cleanup (stream info, meta info)
+ *
* Revision 1.171 2003/11/11 18:44:53 f1rmb
* rename internal API function (_x_<function>).
*
diff --git a/src/input/input_http.c b/src/input/input_http.c
index daf40c664..91efc53d2 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -19,7 +19,7 @@
*
* input plugin for http network streams
*
- * $Id: input_http.c,v 1.70 2003/11/14 23:00:41 f1rmb Exp $
+ * $Id: input_http.c,v 1.71 2003/11/15 13:01:08 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -360,7 +360,7 @@ static void http_plugin_read_metainf (input_plugin_t *this_gen) {
xine_set_meta_info(this->stream, XINE_META_INFO_TITLE, songtitle);
/* prepares the event */
- radio = this->stream->meta_info [XINE_META_INFO_ALBUM];
+ radio = xine_get_meta_info(this->stream, XINE_META_INFO_ALBUM);
if (radio) {
strcpy(data.str, radio); /* WARNING: the data.str is char[256] */
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index 6c3fd0c0f..076c5cc60 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -38,7 +38,7 @@
* usage:
* xine pvr:/<prefix_to_tmp_files>\!<prefix_to_saved_files>\!<max_page_age>
*
- * $Id: input_pvr.c,v 1.34 2003/11/11 18:44:54 f1rmb Exp $
+ * $Id: input_pvr.c,v 1.35 2003/11/15 13:01:09 miguelfreitas Exp $
*/
/**************************************************************************
@@ -1235,14 +1235,14 @@ static buf_element_t *pvr_plugin_read_block (input_plugin_t *this_gen, fifo_buff
if( this->pvr_play_paused )
speed = XINE_SPEED_PAUSE;
- if( this->pvr_playing && this->stream->stream_info[XINE_STREAM_INFO_IGNORE_VIDEO] ) {
+ if( this->pvr_playing && xine_get_stream_info(this->stream, XINE_STREAM_INFO_IGNORE_VIDEO) ) {
/* video decoding has being disabled. avoid tweaking the clock */
this->pvr_playing = 0;
this->scr_tunning = 0;
pvrscr_speed_tunning(this->scr, 1.0 );
this->want_data = 0;
pthread_cond_signal (&this->wake_pvr);
- } else if ( !this->pvr_playing && !this->stream->stream_info[XINE_STREAM_INFO_IGNORE_VIDEO] ) {
+ } else if ( !this->pvr_playing && !xine_get_stream_info(this->stream,XINE_STREAM_INFO_IGNORE_VIDEO) ) {
this->pvr_playing = 1;
this->play_blk = this->rec_blk;
}
diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c
index cc8135dc0..967468fd3 100644
--- a/src/input/net_buf_ctrl.c
+++ b/src/input/net_buf_ctrl.c
@@ -154,10 +154,10 @@ static void nbc_compute_fifo_length(nbc_t *this,
int64_t video_br, audio_br;
int has_video, has_audio;
- has_video = this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO];
- has_audio = this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO];
- video_br = this->stream->stream_info[XINE_STREAM_INFO_VIDEO_BITRATE];
- audio_br = this->stream->stream_info[XINE_STREAM_INFO_AUDIO_BITRATE];
+ has_video = xine_get_stream_info(this->stream, XINE_STREAM_INFO_HAS_VIDEO);
+ has_audio = xine_get_stream_info(this->stream, XINE_STREAM_INFO_HAS_AUDIO);
+ video_br = xine_get_stream_info(this->stream, XINE_STREAM_INFO_VIDEO_BITRATE);
+ audio_br = xine_get_stream_info(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE);
fifo_free = fifo->buffer_pool_num_free;
fifo_fill = fifo->fifo_size;
@@ -277,8 +277,8 @@ static void nbc_put_cb (fifo_buffer_t *fifo,
if (this->buffering) {
- has_video = this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO];
- has_audio = this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO];
+ has_video = xine_get_stream_info(this->stream, XINE_STREAM_INFO_HAS_VIDEO);
+ has_audio = xine_get_stream_info(this->stream, XINE_STREAM_INFO_HAS_AUDIO);
/* restart playing if high_water_mark is reached by all fifos
* do not restart if has_video and has_audio are false to avoid
* a yoyo effect at the beginning of the stream when these values
@@ -399,8 +399,8 @@ static void nbc_get_cb (fifo_buffer_t *fifo,
if (!this->buffering) {
/* start buffering if one fifo is empty
*/
- int has_video = this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO];
- int has_audio = this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO];
+ int has_video = xine_get_stream_info(this->stream, XINE_STREAM_INFO_HAS_VIDEO);
+ int has_audio = xine_get_stream_info(this->stream, XINE_STREAM_INFO_HAS_AUDIO);
if (fifo->fifo_size == 0 &&
(((fifo == this->video_fifo) && has_video) ||
((fifo == this->audio_fifo) && has_audio))) {
diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c
index 537c14875..cba0bf170 100644
--- a/src/input/vcd/xineplug_inp_vcd.c
+++ b/src/input/vcd/xineplug_inp_vcd.c
@@ -1,5 +1,5 @@
/*
- $Id: xineplug_inp_vcd.c,v 1.7 2003/11/11 18:44:54 f1rmb Exp $
+ $Id: xineplug_inp_vcd.c,v 1.8 2003/11/15 13:01:10 miguelfreitas Exp $
Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
@@ -180,15 +180,13 @@ static void
meta_info_assign(int field, xine_stream_t *stream, const char * info)
{
if (NULL != info) {
- if (stream->meta_info[field])
- free(stream->meta_info[field]);
dbg_print(INPUT_DBG_META, "meta[%d]: %s\n", field, info);
- stream->meta_info[field] = strdup(info);
+ xine_set_meta_info(stream, field, info);
}
}
#define stream_info_assign(field, stream, info) \
- stream->stream_info[field] = info;
+ xine_set_stream_info(stream, field, info);
/* Set stream information. */
static void
@@ -1241,14 +1239,6 @@ vcd_plugin_dispose(input_plugin_t *this_gen)
*/
dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT), "called\n");
-#if 0
- /*FIXME - this causes termination to in waits and adds sleeps. Why? */
- free(my_vcd.stream->meta_info[XINE_META_INFO_ALBUM]);
- free(my_vcd.stream->meta_info[XINE_META_INFO_ARTIST]);
- free(my_vcd.stream->meta_info[XINE_META_INFO_COMMENT]);
- free(my_vcd.stream->meta_info[XINE_META_INFO_GENRE]);
- free(my_vcd.stream->meta_info[XINE_META_INFO_TITLE]);
-#endif
my_vcd.stream = NULL;
#if 0