[Alsaplayer-devel] New release, was: svn checkout 1240 fixes my gtk2 problem

Dominique Michel dominique.michel at citycable.ch
Fri Jul 6 22:27:55 BST 2007


Le Wed, 04 Jul 2007 11:36:38 -0400,
Hubert Chan <hubert at uhoreg.ca> a écrit :

> On 2007-06-28 14:27:31 -0400 Dominique Michel 
> <dominique.michel at citycable.ch> wrote:
> 
> > 						data->tracks[index].track =
> > strdup (name); } }
> > 				continue;
> > 			} else {
> 
> Add this to line 782 (or thereabouts): (Note: untested)
> 
>                  if (data->tracks[1].album)
>                    continue;
> 
> and it should only read the first DTITLE line.  It's not an ideal fix, 
> but it's probably better than the current behaviour.  A proper fix 
> would be much more involved.  I could do it, but I won't have time 
> until September at the earliest.  (I still haven't even had time to 
> update the Debian packages...)
> 
> > 				/* print the album name */
> > 				tmp = strtok (line, "=");
> > 				if (!tmp) {
> > 					alsaplayer_error ("error: no
> > arguments given on %s", line); continue;
> 
> 
> 
 I try this, and it work. I get only the artist name and the song title in the
info window.

I try to do something else. When running with --verbose, I get the right artist
and album name in the console, but they are followed by a segfault:

Searching for CDDB entries on /home/dom/.alsaplayer/cddb ... 
OK
Artist: Le beau lac de Bâle
Album name: Baignades strictement interdites et deuxième ser
No divider found in DTITLE
Artist: Le beau lac de Bâle
Album name: Baignades strictement interdites et deuxième service
Erreur de segmentation

We see at it the second time it go into the loop, AP found no divider (that's
right) and the Artist and Album name are corrects. But a segfault follow. I
have no clue. I try with the xosd interface and get exactly the same result.

Here is the code:

                                                data->tracks[index].track =
strdup (name);
                                        }
                                }
                                continue;
                        } else {
//                              if (data->tracks[1].album)
//                                      continue;
                                  
                                /* print the album name */
                                tmp = strtok (line, "=");
                                if (!tmp) { 
                                        alsaplayer_error ("error: no arguments
given on %s", line);
                                        continue;
                                }
                                tmp = strtok (NULL, "=");
                                if (!tmp) {
                                        alsaplayer_error ("error: no arguments
given on %s", line);
                                        continue;
                                }
                                divider = strstr (tmp, " / ");
                                if (!divider) { 
                                        alsaplayer_error("No divider found in
DTITLE");

// modified code here:
                                        if (!(data->tracks[1].album)) {
// original code:
                                                data->tracks[1].artist =
strdup(tmp);
                                                data->tracks[1].album =
strdup(tmp);

// modified code:
                                        } else {
                                                //data->tracks[1].artist =
strcat(data->tracks[1].artist, strdup(tmp));
                                                data->tracks[1].album =
strcat(data->tracks[1].album, strdup(tmp));
                                        }
// original code:
                                } else {
// modified:
                                        if (!(data->tracks[1].album)) {
// original:
                                                data->tracks[1].album = strdup
(divider+3);
                                                tmp[strlen(tmp)-strlen(data->tracks[1].album)-3]
= '\0';
                                                data->tracks[1].artist = strdup
(tmp);

// modified:
                                        } else {
                                                data->tracks[1].album =
strcat(data->tracks[1].album, strdup (divider+3));
                                                tmp[strlen(tmp)-strlen(data->tracks[1].album)-3]
= '\0';
                                                //data->tracks[1].artist =
strdup (tmp));
                                        }
// end modif
                                }
                                if ((s = strstr(data->tracks[1].artist, "\r")))
{
                                        *s = '\0';
                                }
 

Dominique



More information about the alsaplayer-devel mailing list