summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_cdda.c34
-rw-r--r--src/input/input_dvb.c11
-rw-r--r--src/input/input_v4l.c22
3 files changed, 42 insertions, 25 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 1d4665273..ff14b5790 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -1454,7 +1454,7 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
if (sscanf(buffer, "DTITLE=%s", &buf[0]) == 1) {
char *pt, *artist, *title;
- pt = strrchr(buffer, '=');
+ pt = strchr(buffer, '=');
if (pt) {
pt++;
@@ -1494,7 +1494,7 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
else if (sscanf(buffer, "TTITLE%d=%s", &tnum, &buf[0]) == 2) {
char *pt;
- pt = strrchr(buffer, '=');
+ pt = strchr(buffer, '=');
if (pt)
pt++;
if (this->cddb.track[tnum].title == NULL)
@@ -2438,15 +2438,31 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
}
if(this->cddb.track[this->track].title) {
- lprintf("Track %d Title: %s\n", this->track+1, this->cddb.track[this->track].title);
-
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_TITLE, this->cddb.track[this->track].title);
- }
+ /* Check for track 'titles' of the form <artist> / <title>. */
+ char *pt;
+ pt = strstr(this->cddb.track[this->track].title, " / ");
+ if (pt != NULL) {
+ char *track_artist;
+ track_artist = strdup(this->cddb.track[this->track].title);
+ track_artist[pt - this->cddb.track[this->track].title] = 0;
+ lprintf("Track %d Artist: %s\n", this->track+1, track_artist);
+
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_ARTIST, track_artist);
+ free(track_artist);
+ pt += 3;
+ }
+ else {
+ if(this->cddb.disc_artist) {
+ lprintf("Disc Artist: %s\n", this->cddb.disc_artist);
+
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_ARTIST, this->cddb.disc_artist);
+ }
- if(this->cddb.disc_artist) {
- lprintf("Disc Artist: %s\n", this->cddb.disc_artist);
+ pt = this->cddb.track[this->track].title;
+ }
+ lprintf("Track %d Title: %s\n", this->track+1, pt);
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_ARTIST, this->cddb.disc_artist);
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_TITLE, pt);
}
if(this->cddb.disc_category) {
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index bf62a0ff0..03ab71bd9 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -1650,21 +1650,22 @@ static void load_epg_data(dvb_input_plugin_t *this)
}
/* Prints text to an area, tries to cut the lines in between words. */
-static void render_text_area(osd_renderer_t* renderer, osd_object_t* osd, char* text,
+static void render_text_area(osd_renderer_t* renderer, osd_object_t* osd, const char* text,
int x, int y, int row_space,
int max_x, int max_y, int* height, int color_base) {
/* The position of the text to be printed. */
- char* cursor = text;
+ const char* cursor = text;
+ const char *const text_end = text + strlen(text);
/* The line to be printed next. */
char text_line[512];
int text_width, text_height;
size_t old_line_length, line_cursor;
- char* bound, *old_bound;
+ const char* bound, *old_bound;
*height = 0;
- while (cursor < text + strlen(text)) {
+ while (cursor < text_end) {
bound = cursor;
line_cursor = 0;
text_line[0] = '\0';
@@ -1721,7 +1722,7 @@ static void render_text_area(osd_renderer_t* renderer, osd_object_t* osd, char*
}
/* OK, it did fit, let's try to fit some more. */
- } while (bound < text + strlen(text));
+ } while (bound < text_end);
if (y + text_height + row_space > max_y) {
break;
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index 93725167f..753c99543 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -569,6 +569,12 @@ static int set_frequency(v4l_input_plugin_t *this, unsigned long frequency)
fd = this->radio_fd;
if (frequency != 0) {
+ /* FIXME: Don't assume tuner 0 ? */
+ this->tuner = 0;
+ ret = ioctl(fd, VIDIOCSTUNER, &this->tuner);
+ lprintf("(%d) Response on set tuner to %d\n", ret, this->tuner);
+ this->video_tuner.tuner = this->tuner;
+
if (this->video_tuner.flags & VIDEO_TUNER_LOW) {
this->calc_frequency = frequency * 16;
} else {
@@ -704,16 +710,6 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source)
ret = ioctl(fd, VIDIOCSCHAN, &this->input);
lprintf("(%d) Set channel to %d\n", ret, this->input);
-
- /* FIXME: Don't assume tuner 0 ? */
-
- this->tuner = 0;
-
- ret = ioctl(fd, VIDIOCSTUNER, &this->tuner);
-
- lprintf("(%d) Response on set tuner to %d\n", ret, this->tuner);
-
- this->video_tuner.tuner = this->tuner;
} else {
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
"input_v4l: Not setting video source. No source given\n");
@@ -1025,7 +1021,11 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, 103);
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_Y, 103);
-
+
+ /* Pre-allocate some frames for audio and video so it doesn't have to be
+ * done during capture */
+ allocate_frames(this, 1);
+
/* If we made it here, everything went ok */
this->audio_only = 0;
if (tuner_found)