Please unblock mpg123_1.4.3-4.
Hi!
In version 1.4.3-4, mpg123 now builds fine on non-Linux platforms, and
restores old semantics of a commandline option as they are present in
etch. Debdiff to the current version in testing is attached. Please
unblock.
Thanks,
Daniel.
diff -u mpg123-1.4.3/debian/changelog mpg123-1.4.3/debian/changelog
--- mpg123-1.4.3/debian/changelog
+++ mpg123-1.4.3/debian/changelog
@@ -1,3 +1,13 @@
+mpg123 (1.4.3-4) unstable; urgency=medium
+
+ * src/wav.c: Backport upstream patch for writing WAV output to stdout
+ via '-w -'. Fixes regression from etch. Closes: #493285
+ * debian/rules: Only include ALSA dependencies when respective plugin has
+ been built. Original patch thanks to Petr Salinger. Fixes build failure
+ on GNU/kFreeBSD. Closes: #493423
+
+ -- Daniel Kobras <kobras@debian.org> Sun, 07 Sep 2008 17:02:54 +0200
+
mpg123 (1.4.3-3) unstable; urgency=medium
* src/libmpg123/id3.c: Apply upstream fix for out-of-bounds error in
diff -u mpg123-1.4.3/debian/rules mpg123-1.4.3/debian/rules
--- mpg123-1.4.3/debian/rules
+++ mpg123-1.4.3/debian/rules
@@ -152,7 +152,11 @@
cat debian/substvars; \
exit 1; \
fi
- dh_gencontrol $(ALL_PKGSTR) -- -V'plugin:Recommends=$${alsaplugin:Recommends} | oss-compat | $${dummyplugin:Recommends}'
+ if test -e debian/mpg123/usr/lib/mpg123/output_alsa.so; then \
+ dh_gencontrol $(ALL_PKGSTR) -- -V'plugin:Recommends=$${alsaplugin:Recommends} | oss-compat | $${dummyplugin:Recommends}'; \
+ else \
+ dh_gencontrol $(ALL_PKGSTR) -- -V'plugin:Recommends=oss-compat | $${dummyplugin:Recommends}'; \
+ fi
dh_gencontrol $(DUMMY_PKGSTR) -- -Tdebian/mpg123.substvars
dh_md5sums $(ALL_PKGSTR) $(DUMMY_PKGSTR)
dh_builddeb $(ALL_PKGSTR) $(DUMMY_PKGSTR)
only in patch2:
unchanged:
--- mpg123-1.4.3.orig/src/wav.c
+++ mpg123-1.4.3/src/wav.c
@@ -100,6 +100,7 @@
static FILE *wavfp;
+static int header_written = 0; /* prevent writing multiple headers to stdout */
static long datalen = 0;
static int flipendian=0;
@@ -170,6 +171,25 @@
return 0;
}
+static void close_file(void)
+{
+ if(wavfp != NULL && wavfp != stdout)
+ fclose(wavfp);
+
+ wavfp = NULL;
+}
+
+/* Wrapper over header writing; ensure that stdout doesn't get multiple headers. */
+static size_t write_header(const void*ptr, size_t size)
+{
+ if(wavfp == stdout)
+ {
+ if(header_written) return 1;
+
+ header_written = 1;
+ }
+ return fwrite(ptr, size, 1, wavfp);
+}
int au_open(audio_output_t *ao)
{
@@ -209,7 +229,7 @@
if(open_file(ao->device) < 0)
return -1;
- fwrite(&auhead, sizeof(auhead),1,wavfp);
+ write_header(&auhead, sizeof(auhead));
datalen = 0;
return 0;
@@ -286,11 +306,10 @@
long2littleendian(datalen,RIFF.WAVE.data.datalen,sizeof(RIFF.WAVE.data.datalen));
long2littleendian(datalen+sizeof(RIFF.WAVE),RIFF.WAVElen,sizeof(RIFF.WAVElen));
- if(fwrite(&RIFF, sizeof(RIFF),1,wavfp) != 1)
+ if(write_header(&RIFF, sizeof(RIFF)) != 1)
{
error1("cannot write header: %s", strerror(errno));
- fclose(wavfp);
- wavfp = NULL;
+ close_file();
return -1;
}
@@ -348,7 +367,6 @@
{
if(!wavfp)
return 0;
-
if(fseek(wavfp, 0L, SEEK_SET) >= 0) {
long2littleendian(datalen,RIFF.WAVE.data.datalen,sizeof(RIFF.WAVE.data.datalen));
long2littleendian(datalen+sizeof(RIFF.WAVE),RIFF.WAVElen,sizeof(RIFF.WAVElen));
@@ -356,13 +374,13 @@
long2littleendian(datalen/(from_little(RIFF.WAVE.fmt.Channels,2)*from_little(RIFF.WAVE.fmt.BitsPerSample,2)/8),
RIFF.WAVE.fact.samplelen,sizeof(RIFF.WAVE.fact.samplelen));
#endif
+ /* Always (over)writing the header here; also for stdout, when fseek worked, this overwrite works. */
fwrite(&RIFF, sizeof(RIFF),1,wavfp);
}
else {
warning("Cannot rewind WAV file. File-format isn't fully conform now.");
}
- fclose(wavfp);
- wavfp = NULL;
+ close_file();
return 0;
}
@@ -373,10 +391,13 @@
if(fseek(wavfp, 0L, SEEK_SET) >= 0) {
long2bigendian(datalen,auhead.datalen,sizeof(auhead.datalen));
+ /* Always (over)writing the header here; also for stdout, when fseek worked, this overwrite works. */
fwrite(&auhead, sizeof(auhead),1,wavfp);
}
- fclose(wavfp);
- wavfp = NULL;
+ else
+ warning("Cannot rewind AU file. File-format isn't fully conform now.");
+
+ close_file();
return 0;
}
@@ -385,8 +406,7 @@
{
if(!wavfp) return 0;
- fclose(wavfp);
- wavfp = NULL;
+ close_file();
return 0;
}
Reply to: