Mercurial > audlegacy-plugins
diff src/tta/libtta.c @ 1165:5f3b30860b48 trunk
[svn] - add playback->playing code.
- if tta file doesn't have metadata, file name will be used as the title.
author | yaz |
---|---|
date | Wed, 06 Jun 2007 22:34:54 -0700 |
parents | 949457464b28 |
children | 4bd7e72a6605 |
line wrap: on
line diff
--- a/src/tta/libtta.c Wed Jun 06 21:44:52 2007 -0700 +++ b/src/tta/libtta.c Wed Jun 06 22:34:54 2007 -0700 @@ -178,7 +178,12 @@ static gchar * get_song_title(TitleInput *tuple) { - return xmms_get_titlestring(xmms_get_gentitle_format(), tuple); + gchar *title = xmms_get_titlestring(xmms_get_gentitle_format(), tuple); + if(!title || !strcmp(title, "")) { + g_free(title); + title = g_strdup(tuple->file_name); + } + return title; } static void @@ -186,8 +191,8 @@ { TitleInput *tuple; - *length = -1; - *title = NULL; + *length = -1; + *title = NULL; if ((tuple = get_song_tuple(filename)) != NULL) { *length = tuple->length; @@ -509,6 +514,7 @@ g_free (title); playing = TRUE; + playback->playing = 1; seek_position = -1; read_samples = -1; @@ -527,6 +533,7 @@ if (playing) { playing = FALSE; + playback->playing = 0; pthread_join (decode_thread, NULL); playback->output->close_audio (); close_tta_file (&info);