summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2003-11-08 22:20:35 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2003-11-08 22:20:35 +0000
commit91ae797b38921b4dc54c5652d1f08ed97777f0f8 (patch)
tree354efe7f7a0a649dd075e7a490b1d8786128ad56 /src
parent684fe3aec5e100f92cd7675ccbea9b88321ac524 (diff)
downloadxine-lib-91ae797b38921b4dc54c5652d1f08ed97777f0f8.tar.gz
xine-lib-91ae797b38921b4dc54c5652d1f08ed97777f0f8.tar.bz2
Use info helper functions.
CVS patchset: 5709 CVS date: 2003/11/08 22:20:35
Diffstat (limited to 'src')
-rw-r--r--src/input/input_dvb.c8
-rw-r--r--src/input/input_http.c27
-rw-r--r--src/input/input_v4l.c30
3 files changed, 28 insertions, 37 deletions
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 88c76daac..551222b17 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -419,9 +419,7 @@ static void switch_channel (dvb_input_plugin_t *this) {
this->channels[this->channel].name);
ui_data.str_len = strlen (ui_data.str);
- 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 (ui_data.str);
+ xine_set_meta_info(this->stream, XINE_META_INFO_TITLE, ui_data.str);
event.type = XINE_EVENT_UI_SET_TITLE;
event.stream = this->stream;
@@ -957,9 +955,7 @@ static int dvb_plugin_open (input_plugin_t *this_gen) {
snprintf (str, 256, "%04d - %s", this->channel,
this->channels[this->channel].name);
- 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 (str);
+ xine_set_meta_info(this->stream, XINE_META_INFO_TITLE, str);
return 1;
}
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 71a1f9e2c..9debf821f 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.65 2003/09/25 13:47:17 f1rmb Exp $
+ * $Id: input_http.c,v 1.66 2003/11/08 22:20:36 tmattern Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -355,9 +355,7 @@ static void http_plugin_read_metainf (input_plugin_t *this_gen) {
free(this->shoutcast_songtitle);
this->shoutcast_songtitle = strdup(songtitle);
- 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 (songtitle);
+ xine_set_meta_info(this->stream, XINE_META_INFO_TITLE, songtitle);
/* prepares the event */
radio = this->stream->meta_info [XINE_META_INFO_ALBUM];
@@ -500,21 +498,21 @@ static int read_shoutcast_header(http_input_plugin_t *this) {
#endif
if (!strncasecmp(this->buf, "icy-name:", 9)) {
- this->stream->meta_info [XINE_META_INFO_ALBUM]
- = strdup (this->buf + 9 + (*(this->buf + 9) == ' '));
- this->stream->meta_info [XINE_META_INFO_TITLE]
- = strdup (this->buf + 9 + (*(this->buf + 9) == ' '));
+ xine_set_meta_info(this->stream, XINE_META_INFO_ALBUM,
+ (this->buf + 9 + (*(this->buf + 9) == ' ')));
+ xine_set_meta_info(this->stream, XINE_META_INFO_TITLE,
+ (this->buf + 9 + (*(this->buf + 9) == ' ')));
}
-
+
if (!strncasecmp(this->buf, "icy-genre:", 10)) {
- this->stream->meta_info [XINE_META_INFO_GENRE]
- = strdup (this->buf + 10 + (*(this->buf + 10) == ' '));
+ xine_set_meta_info(this->stream, XINE_META_INFO_GENRE,
+ (this->buf + 10 + (*(this->buf + 10) == ' ')));
}
-
+
/* icy-notice1 is always the same */
if (!strncasecmp(this->buf, "icy-notice2:", 12)) {
- this->stream->meta_info [XINE_META_INFO_COMMENT]
- = strdup (this->buf + 12 + (*(this->buf + 12) == ' '));
+ xine_set_meta_info(this->stream, XINE_META_INFO_COMMENT,
+ (this->buf + 12 + (*(this->buf + 12) == ' ')));
}
/* metadata interval (in byte) */
@@ -1020,4 +1018,3 @@ plugin_info_t xine_plugin_info[] = {
{ PLUGIN_INPUT, 13, "http", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
-
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index 141277362..25190d7c3 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -732,11 +732,11 @@ static int open_radio_capture_device(v4l_input_plugin_t *this)
if (set_input_source(this, this->tuner_name) > 0)
tuner_found = 1;
- this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = periods;
- this->stream->stream_info[XINE_STREAM_INFO_AUDIO_BITS] = bits;
- this->stream->stream_info[XINE_STREAM_INFO_AUDIO_SAMPLERATE] = rate;
- this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO] = 1;
- this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = 0;
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, periods);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_AUDIO_BITS, bits);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, rate);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
/*
* Pre allocate some frames for audio and video. This way this hasn't to be
@@ -845,13 +845,13 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
return 0;
}
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_WIDTH] = resolutions[j].width;
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HEIGHT] = resolutions[j].height;
- this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = periods;
- this->stream->stream_info[XINE_STREAM_INFO_AUDIO_BITS] = bits;
- this->stream->stream_info[XINE_STREAM_INFO_AUDIO_SAMPLERATE] = rate;
- this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO] = 1;
- this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = 1;
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, resolutions[j].width);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, resolutions[j].height);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, periods);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_AUDIO_BITS, bits);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, rate);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 1);
/*
* Pre allocate some frames for audio and video. This way this hasn't to be
@@ -997,10 +997,8 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
}
/* Save dimensions */
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_WIDTH] =
- resolutions[j].width;
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HEIGHT] =
- resolutions[j].height;
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, resolutions[j].width);
+ xine_set_stream_info(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, resolutions[j].height);
/* Using deinterlaceing is highly recommended. Setting to true */
this->old_interlace =