#99 globecomice requires old libshout


Attempting to use the latest libshout-2.0 will result
in compiler errors, documentation should state which
version to use:

globecomice.c:224: error: syntax error before '*' token
globecomice.c: In function `playFile':
globecomice.c:232: error: `filename' undeclared (first
use in this function)
globecomice.c:232: error: (Each undeclared identifier
is reported only once
globecomice.c:232: error: for each function it appears in.)
globecomice.c:255: error: `conn' undeclared (first use
in this function)
globecomice.c: In function `main':
globecomice.c:368: error: `shout_conn_t' undeclared
(first use in this function)
globecomice.c:368: error: syntax error before "conn"
globecomice.c:386: error: `conn' undeclared (first use
in this function)

There are quite a few items that are simply undeclared
or their structures/datatypes have changed. This seems
to be very poorly documented within libshout -- I could
not find any mention on the web or in their
documentation. I did come across an old document here
at sourceforge where someone else was having trouble,
ljardine recommended to use the 1.0.9 version of libshout.

In Gentoo, this requires: emege =libshout-1.0.9

Don't forget to unmerge libshout 2 first.

The differences between libshout 1.0.9 and libshout 2.0
are SIGNIFICANT. Compiled with success using


  • Lewis Jardine

    Lewis Jardine - 2004-12-08

    Logged In: YES

    Not specifically mentioning that libshout-1 is required is,
    I think, bitrot: the last tar release of jukebox predates
    the release of icecast2.

    <rant>This is clearly icecast's fault: do not release a
    product with the same name and a higher version number
    unless it does the same thing, you stupid idiots. Changing
    the API across a major version is just about acceptable;
    changing the protocol used, but keeping the name, is just
    dumb. Imagine if the Samba team released samba 5, and but it
    did NFS instead of CIFS, or if the new Apache turned out to
    be an FTP server.</rant>

    No matter how righteously indignant I am, this problem is
    not going to go away until jukebox either supports icecast2
    (easier now that icecast has realised the OGG is not the
    killer app they thought it was and actually supports mp3),
    or notes in the documentation that it is incompatible with it.

  • Lewis Jardine

    Lewis Jardine - 2004-12-08

    Logged In: YES

    Towards the latter solution, here's a diff -u of Matt
    Williams (mattrwilliams)' port of globecomice from libshout1
    to libshout2 (posted in
    https://sourceforge.net/forum/message.php?msg_id=2140748 )
    against 4.1pre4, which I believe is what it was ported from.
    Hopefully it should still apply easily to the CVS version.

    This is only half the battle though: we need to either
    detect if the user has icecast 1 or 2 (or somehow explain
    the problem to them and ask them to choose), and then
    compile the appropriate one, or somehow write a globecomice
    that's compatible with either. The latter would be a hell of
    a lot easier if the two (completely incompatible)
    implementations didn't use the same header and library
    names. (Not to mention that a system could potentially have
    BOTH versions installed at the same time.

    /I did not write this code/, Matt Williams (mattrwilliams)
    did. It is not my intention to pass of his work as my own;
    any monkey can make a diff.

  • Lewis Jardine

    Lewis Jardine - 2004-12-08

    Logged In: YES

    --- jukebox-4.1/src/globecomice.c Fri Feb 1 22:30:24 2002
    +++ ./globecomice2.c Wed Dec 8 04:20:55 2004
    @@ -1,4 +1,5 @@
    #include <signal.h>
    +#include <errno.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    @@ -142,13 +143,14 @@

    #define BUFSIZE 4096

    -void playFile(shout_conn_t *conn,char *filename)
    +void playFile(shout_t *conn,char *filename)
    int fd;
    int searchsize;
    int offset;
    struct MP3Header head;
    char* chopped_filename;
    +shout_metadata_t *metadata;

    if (fd<0) {
    @@ -173,13 +175,20 @@

    - shout_update_metadata(conn, chopped_filename);

    if (checkMP3(head)) {
    - char buff[4096];
    +char buff[BUFSIZE];
    long rbuf, ret, total=0;
    int sec10=head.bitrate*1280;
    - printf("Playing %s with bitrate
    +if (ret!=SHOUTERR_SUCCESS) printf ("Error adding metadata\n");
    +if (ret!=SHOUTERR_SUCCESS) printf ("Error setting
    +printf("Playing %s (%s) with bitrate
    while (1) {
    if (goSeek) {
    @@ -188,29 +197,30 @@
    if (goQuit) {
    - break;
    rbuf = read(fd,buff,BUFSIZE);
    +if (rbuf < 0) printf("error %s\n", strerror(errno));
    total = total + rbuf;

    if (rbuf > 0) {
    - ret = shout_send_data(conn, buff, rbuf);
    - if (!ret) {
    +ret = shout_send(conn, buff, rbuf);
    +if (ret != SHOUTERR_SUCCESS) {
    /* Something wrong occured (timeout?) */
    - printf("globecomice: Send error: %i...\n",
    +printf("globecomice: Send error: %s...\n",

    /* Try to reconnect before giving up */
    printf("globecomice: Reconnecting to the icecast
    - shout_disconnect(conn);
    - if (!shout_connect(conn)) {
    +if (!shout_open(conn)) {
    printf("globecomice: Error, couldn't reconnect to

    /* Try to send data again */
    - ret = shout_send_data(conn, buff, rbuf);
    - if (!ret) {
    - printf("globecomice: Send data FAILED again: %d\n",
    +ret = shout_send(conn, buff, rbuf);
    +if (ret != SHOUTERR_SUCCESS) {
    +printf("globecomice: Send data FAILED again: %s\n",
    @@ -218,7 +228,7 @@

    - shout_sleep(conn);
    @@ -276,7 +286,7 @@

    int main(int argc,char **argv)
    - shout_conn_t conn;
    +shout_t *conn;
    int connected=0;
    const char *user;
    char* chopped_filename;
    @@ -290,15 +300,19 @@
    printf("Must set environment variable JUKEBOXBIN\n");
    - shout_init_connection(&conn);

    - conn.ip=argv[1];
    - conn.port=atoi(argv[2]);
    - conn.password=argv[3];
    - conn.mount=argv[5];
    - conn.name=host;
    - conn.description="GlobeCom Jukebox";
    +shout_set_description(conn,"GlobeCom Jukebox");

    @@ -310,16 +324,18 @@
    while(1) {
    char filename[BUFSIZE+1];
    if (!getFilename(connected,filename,user)) {
    - shout_disconnect(&conn);
    if (!connected) {
    - if (!shout_connect(&conn)) {
    - printf("Couldn't connect to icecast server\n");
    +if (shout_get_connected(conn) != SHOUTERR_CONNECTED) {
    +printf("Couldn't connect to icecast server:
    - playFile(&conn,filename);

  • Paradxum

    Paradxum - 2005-08-23

    Logged In: YES

    To anyone dealing with this problem.... is there any
    DISADVANTAGE to icecast2???? I think it's time we ditch
    icecast1 and just require icecast2.... it's about time if
    this is an issue.


Log in to post a comment.