diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | m4/video_out.m4 | 4 | ||||
-rw-r--r-- | po/Makefile.in.in | 42 | ||||
-rw-r--r-- | src/demuxers/demux_cdda.c | 16 | ||||
-rw-r--r-- | src/input/input_cdda.c | 223 |
5 files changed, 127 insertions, 160 deletions
diff --git a/configure.ac b/configure.ac index 7fbea32ef..ecdbb2b1b 100644 --- a/configure.ac +++ b/configure.ac @@ -221,7 +221,7 @@ if test x"$enable_iconvtest" != x"no"; then fi AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.16.1]) +AM_GNU_GETTEXT_VERSION([0.17]) AC_PROG_GMSGFMT_PLURAL AC_CHECK_LIB([c], [dlopen], [DYNAMIC_LD_LIBS=""], diff --git a/m4/video_out.m4 b/m4/video_out.m4 index c1504df19..7870b7558 100644 --- a/m4/video_out.m4 +++ b/m4/video_out.m4 @@ -419,13 +419,13 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ [test $default_enable_xvmc = disable && enable_xvmc="no"]) AC_ARG_WITH([xvmc-path], [AS_HELP_STRING([--with-xvmc-path=PATH], [where libXvMC for the xvmc plugin are installed])], - [], [with_xvmc_path="${x_libraries:-/usr/lib}"]) + [], [with_xvmc_path="$x_libraries"]) AC_ARG_WITH([xvmc-lib], [AS_HELP_STRING([--with-xvmc-lib=LIBNAME], [The name of the XvMC library libLIBNAME.so for the xvmc plugin])], [], [with_xvmc_lib="XvMCW"]) AC_ARG_WITH([xxmc-path], [AS_HELP_STRING([--with-xxmc-path=PATH], [Where libXvMC for the xxmc plugin are installed])], - [], [with_xxmc_path="${x_libraries:-/usr/lib}"]) + [], [with_xxmc_path="$x_libraries"]) AC_ARG_WITH([xxmc-lib], [AS_HELP_STRING([--with-xxmc-lib=LIBNAME], [The name of the XvMC library libLIBNAME.so for the xxmc plugin])], [], [with_xxmc_lib="XvMCW"]) diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 5022b8b18..fecf500f3 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -1,5 +1,5 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu> +# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper <drepper@gnu.ai.mit.edu> # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public @@ -8,7 +8,8 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.16 +# Origin: gettext-0.17 +GETTEXT_MACRO_VERSION = 0.17 PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -95,11 +96,18 @@ CATALOGS = @CATALOGS@ mv t-$@ $@ -all: all-@USE_NLS@ +all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: +# Ensure that the gettext macros and this Makefile.in.in are in sync. +check-macro-version: + @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that @@ -130,16 +138,34 @@ stamp-po: $(srcdir)/$(DOMAIN).pot # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ + package_gnu='GNU '; \ + else \ + package_gnu=''; \ + fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --msgid-bugs-address="$$msgid_bugs_address" + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_gnu}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c index 52c0a8d6d..c6e8114fd 100644 --- a/src/demuxers/demux_cdda.c +++ b/src/demuxers/demux_cdda.c @@ -60,6 +60,7 @@ typedef struct { input_plugin_t *input; int status; + int send_newpts; int seek_flag; /* this is set when a seek just occurred */ } demux_cdda_t; @@ -91,9 +92,9 @@ static int demux_cdda_send_chunk (demux_plugin_t *this_gen) { buf->extra_info->input_time = buf->pts / 90; buf->decoder_flags |= BUF_FLAG_FRAME_END; - if (this->seek_flag) { - _x_demux_control_newpts(this->stream, buf->pts, BUF_FLAG_SEEK); - this->seek_flag = 0; + if (this->send_newpts) { + _x_demux_control_newpts(this->stream, buf->pts, this->seek_flag); + this->send_newpts = this->seek_flag = 0; } this->audio_fifo->put (this->audio_fifo, buf); @@ -146,9 +147,14 @@ static int demux_cdda_seek (demux_plugin_t *this_gen, off_t start_pos, int start this->input->seek(this->input, start_pos & ~3, SEEK_SET); else this->input->seek(this->input, start_time * CD_BYTES_PER_SECOND, SEEK_SET); - this->seek_flag = 1; + this->status = DEMUX_OK; - _x_demux_flush_engine (this->stream); + + this->send_newpts = 1; + if (playing) { + this->seek_flag = BUF_FLAG_SEEK; + _x_demux_flush_engine (this->stream); + } return this->status; } diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index cb4c9c20c..9c51a16da 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -124,7 +124,7 @@ typedef struct _cdrom_toc { *************************************************************************/ #define MAX_TRACKS 99 -#define CACHED_FRAMES 500 +#define CACHED_FRAMES 100 typedef struct { int start; @@ -1410,6 +1410,73 @@ static int _cdda_cddb_handle_code(char *buf) { return err; } +static inline char *_cdda_append (/*const*/ char *first, const char *second) +{ + if (!first) + return strdup (second); + + char *result = (char *) realloc (first, strlen (first) + strlen (second) + 1); + strcat (result, second); + return result; +} + +static void _cdda_parse_cddb_info (cdda_input_plugin_t *this, char *buffer, char **dtitle) +{ + /* buffer should be no more than 2048 bytes... */ + char buf[2048]; + int track_no; + + if (sscanf (buffer, "DTITLE=%s", &buf[0]) == 1) { + char *pt = strchr (buffer, '='); + if (pt) { + ++pt; + + *dtitle = _cdda_append (*dtitle, pt); + pt = strdup (*dtitle); + + char *title = strstr (pt, " / "); + if (title) + { + *title = 0; + title += 3; + free (this->cddb.disc_artist); + this->cddb.disc_artist = strdup (pt); + } + else + title = pt; + + free (this->cddb.disc_title); + this->cddb.disc_title = strdup (title); + + free (pt); + } + } + else if (sscanf (buffer, "DYEAR=%s", &buf[0]) == 1) { + char *pt = strchr (buffer, '='); + if (pt && strlen (pt) == 5) + this->cddb.disc_year = strdup (pt + 1); + } + else if(sscanf(buffer, "DGENRE=%s", &buf[0]) == 1) { + char *pt = strchr(buffer, '='); + if (pt) + this->cddb.disc_category = strdup (pt + 1); + } + else if (sscanf (buffer, "TTITLE%d=%s", &track_no, &buf[0]) == 2) { + char *pt = strchr(buffer, '='); + this->cddb.track[track_no].title = _cdda_append (this->cddb.track[track_no].title, pt + 1); + } + else if (!strncmp (buffer, "EXTD=", 5)) + { + if (!this->cddb.disc_year) + { + int nyear; + char *y = strstr (buffer, "YEAR:"); + if (y && sscanf (y + 5, "%4d", &nyear) == 1) + asprintf (&this->cddb.disc_year, "%d", nyear); + } + } +} + /* * Try to load cached cddb infos */ @@ -1444,82 +1511,16 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) { return 0; } else { - char buffer[256], *ln; - char buf[256]; - int tnum; + char buffer[2048], *ln; char *dtitle = NULL; - while ((ln = fgets(buffer, 255, fd)) != NULL) { - - buffer[strlen(buffer) - 1] = '\0'; - - if (sscanf(buffer, "DTITLE=%s", &buf[0]) == 1) { - char *pt, *artist, *title; - - pt = strchr(buffer, '='); - if (pt) { - pt++; - - if (dtitle != NULL) - { - dtitle = (char *) realloc(dtitle, strlen(dtitle) + strlen(pt) + 1); - strcat(dtitle, pt); - pt = dtitle; - } - dtitle = strdup(pt); - - artist = pt; - title = strstr(pt, " / "); - if (title) { - *title++ = '\0'; - title += 2; - } - else { - title = artist; - artist = NULL; - } - - if (artist) - this->cddb.disc_artist = strdup(artist); - - this->cddb.disc_title = strdup(title); - } - } - else if (sscanf(buffer, "DYEAR=%s", &buf[0]) == 1) { - char *pt; + while ((ln = fgets(buffer, sizeof (buffer) - 1, fd)) != NULL) { - pt = strrchr(buffer, '='); - pt++; - if (pt != NULL && strlen(pt) == 4) - this->cddb.disc_year = strdup(pt); - } - else if (sscanf(buffer, "TTITLE%d=%s", &tnum, &buf[0]) == 2) { - char *pt; - - pt = strchr(buffer, '='); - if (pt) - pt++; - if (this->cddb.track[tnum].title == NULL) - this->cddb.track[tnum].title = strdup(pt); - else - { - this->cddb.track[tnum].title - = (char *) realloc(this->cddb.track[tnum].title, strlen(this->cddb.track[tnum].title) + strlen(pt) + 1); - strcat(this->cddb.track[tnum].title, pt); - } - } - else { - if (!strncmp(buffer, "EXTD=", 5)) { - char *y; - int nyear; - - y = strstr(buffer, "YEAR:"); - if (y && this->cddb.disc_year == NULL) { - if (sscanf(y+5, "%4d", &nyear) == 1) - asprintf(&this->cddb.disc_year, "%d", nyear); - } - } - } + int length = strlen (buffer); + if (length && buffer[length - 1] == '\n') + buffer[length - 1] = '\0'; + + _cdda_parse_cddb_info (this, buffer, &dtitle); } fclose(fd); free(dtitle); @@ -1785,82 +1786,13 @@ static int _cdda_cddb_retrieve(cdda_input_plugin_t *this) { memset(&buffercache, 0, sizeof(buffercache)); while (strcmp(buffer, ".")) { - char buf[2048]; - int tnum; size_t bufsize = strlen(buffercache); memset(&buffer, 0, sizeof(buffer)); _cdda_cddb_socket_read(this, buffer, sizeof(buffer) - 1); snprintf(buffercache + bufsize, sizeof(buffercache) - bufsize, "%s\n", buffer); - if (sscanf(buffer, "DTITLE=%s", &buf[0]) == 1) { - char *pt, *artist, *title; - - pt = strrchr(buffer, '='); - if (pt) { - pt++; - - if (dtitle != NULL) - { - dtitle = (char *) realloc(dtitle, strlen(dtitle) + strlen(pt) + 1); - strcat(dtitle, pt); - pt = dtitle; - } - dtitle = strdup(pt); - - artist = pt; - title = strstr(pt, " / "); - if (title) { - *title++ = '\0'; - title += 2; - } - else { - title = artist; - artist = NULL; - } - - if (artist) { - this->cddb.disc_artist = strdup(artist); - } - this->cddb.disc_title = strdup(title); - } - } - else if(sscanf(buffer, "DYEAR=%s", &buf[0]) == 1) { - char *pt; - - pt = strrchr(buffer, '='); - pt++; - if (pt != NULL && strlen(pt) == 4) - this->cddb.disc_year = strdup(pt); - } - else if (sscanf(buffer, "TTITLE%d=%s", &tnum, &buf[0]) == 2) { - char *pt; - - pt = strrchr(buffer, '='); - if (pt) { - pt++; - if (this->cddb.track[tnum].title == NULL) - this->cddb.track[tnum].title = strdup(pt); - else - { - this->cddb.track[tnum].title - = (char *) realloc(this->cddb.track[tnum].title, strlen(this->cddb.track[tnum].title) + strlen(pt) + 1); - strcat(this->cddb.track[tnum].title, pt); - } - } - } - else { - if (!strncmp(buffer, "EXTD=", 5)) { - char *y; - int nyear; - - y = strstr(buffer, "YEAR:"); - if (y && this->cddb.disc_year == NULL) { - if (sscanf(y+5, "%4d", &nyear) == 1) - asprintf(&this->cddb.disc_year, "%d", nyear); - } - } - } + _cdda_parse_cddb_info (this, buffer, &dtitle); } free(dtitle); @@ -2464,6 +2396,9 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) { } lprintf("Track %d Title: %s\n", this->track+1, pt); + char tracknum[4]; + snprintf(tracknum, 4, "%d", this->track+1); + _x_meta_info_set_utf8(this->stream, XINE_META_INFO_TRACK_NUMBER, tracknum); _x_meta_info_set_utf8(this->stream, XINE_META_INFO_TITLE, pt); } |