1 --- amp-0.7.6.orig/audio.c
9 void statusDisplay(struct AUDIO_HEADER *header, int frameNo)
13 uid_t my_uid = getuid();
16 - set_realtime_priority();
18 - setreuid(my_uid, my_uid);
20 + set_realtime_priority();
22 - prefetch_initial_fill();
23 + setreuid(my_uid, my_uid);
25 + prefetch_initial_fill();
27 #endif /* LINUX_REALTIME */
31 -#ifndef LINUX_REALTIME
32 + //#ifndef LINUX_REALTIME
33 if (A_FORMAT_WAVE) wav_begin();
34 -#endif /* LINUX_REALTIME */
35 + //#endif /* LINUX_REALTIME */
37 if ((g=gethdr(&header))!=0) {
38 report_header_error(g);
40 if (header.protection_bit==0) getcrc();
43 - if (setup_fancy_audio(&header)!=0) {
44 - warn("Cannot set up direct-to-DMA audio. Exiting\n");
47 + if (setup_fancy_audio(&header)!=0) {
48 + warn("Cannot set up direct-to-DMA audio. Exiting\n");
53 + if (setup_audio(&header)!=0) {
54 + warn("Cannot set up audio. Exiting\n");
58 if (setup_audio(&header)!=0) {
59 warn("Cannot set up audio. Exiting\n");
64 - if (start_fancy_audio(&header)!=0) {
65 - warn("Cannot start direct-to-DMA audio. Exiting\n");
68 + if (start_fancy_audio(&header)!=0) {
69 + warn("Cannot start direct-to-DMA audio. Exiting\n");
73 #endif /* LINUX_REALTIME */
76 if ((g=gethdr(&header))!=0) {
77 report_header_error(g);
79 - cleanup_fancy_audio();
81 + cleanup_fancy_audio();
84 + if (g==GETHDR_EOF && A_FORMAT_WAVE) wav_end(&header);
87 if (g==GETHDR_EOF && A_FORMAT_WAVE) wav_end(&header);
88 #endif /* LINUX_REALTIME */
93 - if (block_fancy_audio(snd_eof)!=0) {
94 - warn("Problems with direct-to-DMA audio\n");
97 + if (block_fancy_audio(snd_eof)!=0) {
98 + warn("Problems with direct-to-DMA audio\n");
104 #ifdef LINUX_REALTIME
105 - if (stop_fancy_audio()!=0) {
106 - warn("Cannot stop direct-to-DMA audio. Exiting\n");
109 + if (stop_fancy_audio()!=0) {
110 + warn("Cannot stop direct-to-DMA audio. Exiting\n");
117 int main(int argc,char **argv)
122 argPos=args(argc,argv); /* process command line arguments */
124 @@ -194,11 +217,27 @@
126 for(;argPos<argc;argPos++) {
127 #ifdef LINUX_REALTIME
128 - if (geteuid() != 0)
129 - die("effective UID not root, cannot use realtime buffering\n");
130 - rt_play(argv[argPos]);
131 + if (stat(argv[argPos], &st) < 0) {
132 + warn("Could not stat file: %s\n",argv[argPos]);
135 + if (S_ISREG(st.st_mode)) {
138 + if (geteuid() != 0) {
142 +// if (geteuid() != 0)
143 +// die("effective UID not root, cannot use realtime buffering\n");
144 + rt_play(argv[argPos]);
147 + play(argv[argPos],0);
150 #else /* LINUX_REALTIME */
151 - play(argv[argPos],0);
152 + play(argv[argPos],0);
153 #endif /* LINUX_REALTIME */
157 int ready_audio(void)
159 #ifdef LINUX_REALTIME
160 - return ready_fancy_audio();
162 + return ready_fancy_audio();
172 void play(char *inFileStr, char *outFileStr)
174 - if (strcmp(inFileStr,"-")==0)
175 + if (strcmp(inFileStr,"-")==0) {
179 if ((in_file=fopen(inFileStr,"r"))==NULL) {
180 warn("Could not open file: %s\n",inFileStr);
181 --- amp-0.7.6.orig/getbits.c
182 +++ amp-0.7.6/getbits.c
190 * buffer and bit manipulation functions ***************************************
193 static inline int get_input(unsigned char* bp, unsigned int size)
195 #ifdef LINUX_REALTIME
196 - return prefetch_get_input(bp,size);
198 + return prefetch_get_input(bp,size);
201 + if ( fread( bp , 1, size, in_file) != size)
202 + if (feof(in_file)) return GETHDR_EOF;
203 + else return GETHDR_ERR;
206 #else /* LINUX_REALTIME */
207 if ( fread( bp , 1, size, in_file) != size)
208 if (feof(in_file)) return GETHDR_EOF;
209 --- amp-0.7.6.orig/rtbuf.c
210 +++ amp-0.7.6/rtbuf.c
212 int block_fancy_audio(int snd_eof)
215 -struct fd_set wmask;
220 --- amp-0.7.6.orig/buffer.c
221 +++ amp-0.7.6/buffer.c
228 struct ringBuffer { /* A ring buffer to store the data in */
229 char *bufferPtr; /* buffer pointer */
230 int inPos, outPos; /* positions for reading and writing */
234 #ifdef LINUX_REALTIME
235 - rt_printout((short*) sample_buffer, j * sizeof(short));
237 + rt_printout((short*) sample_buffer, j * sizeof(short));
240 + if (AUDIO_BUFFER_SIZE==0)
241 + audioWrite((char*)sample_buffer, j * sizeof(short));
243 + audioBufferWrite((char*)sample_buffer, j * sizeof(short));
245 #else /* LINUX_REALTIME */
246 if (AUDIO_BUFFER_SIZE==0)
247 audioWrite((char*)sample_buffer, j * sizeof(short));
248 --- amp-0.7.6.orig/debian/README.Debian
249 +++ amp-0.7.6/debian/README.Debian
252 +----------------------
254 +amp (Audio Mpeg Player) is a realtime MPEG compressed audio file
257 +amp works with both MPEG1 and MPEG2 audio files, layers 2 and 3.
259 +Ed Boraas <ed@debian.org>, Sun Jun 13 01:19:41 MDT 1999
262 --- amp-0.7.6.orig/debian/changelog
263 +++ amp-0.7.6/debian/changelog
265 +amp (0.7.6-7) frozen unstable; urgency=low
267 + * Do not install with setuid root. (closes: #62519)
269 + -- Fredrik Hallenberg <hallon@debian.org> Mon, 17 Apr 2000 09:43:32 +0200
271 +amp (0.7.6-6) unstable; urgency=low
273 + * Forgot to change maintainer in control.
274 + * Updated standards version to 3.0.0.
276 + -- Fredrik Hallenberg <hallon@debian.org> Sun, 17 Oct 1999 01:15:45 +0200
278 +amp (0.7.6-5) unstable; urgency=low
281 + * Use dh_suidregister.
282 + * Fixed realtime stuff so it is only used when playing regular files.
283 + (closes: #41900, #44493)
285 + -- Fredrik Hallenberg <hallon@debian.org> Sat, 16 Oct 1999 12:00:57 +0200
287 +amp (0.7.6-4) unstable; urgency=low
289 + * Now /really/ runs suid root :)
290 + * Removed deprecated dh_du from debian/rules
292 + -- Ed Boraas <ed@debian.org> Mon, 14 Jun 1999 23:55:40 -0600
295 +amp (0.7.6-3) unstable; urgency=low
297 + * Fixed upstream realtime support bug in rtbuf.c and compiled
298 + with realtime support enabled. (Closes: #25346)
299 + * amp now runs suid root (required for realtime support).
300 + * All non-wishlist bugs are now fixed.
302 + -- Ed Boraas <ed@debian.org> Mon, 14 Jun 1999 11:31:04 -0600
305 +amp (0.7.6-2) unstable; urgency=low
309 + -- Ed Boraas <ed@debian.org> Sun, 13 Jun 1999 01:19:11 -0600
312 +amp (0.7.6-1) unstable; urgency=low
316 + -- Ben Gertzfield <che@debian.org> Sun, 25 Jan 1998 01:50:28 -0800
319 +mode: debian-changelog
320 +add-log-mailing-address: "hallon@debian.org"
322 --- amp-0.7.6.orig/debian/control
323 +++ amp-0.7.6/debian/control
327 +Section: non-free/sound
328 +Maintainer: Fredrik Hallenberg <hallon@debian.org>
329 +Standards-Version: 3.0.0
333 +Section: non-free/sound
334 +Depends: ${shlibs:Depends}
335 +Description: The Audio MPEG Player
336 + amp is an MPEG audio file player.
338 + amp can play MPEG1 or MPEG2 files, layers 2 and 3.
339 --- amp-0.7.6.orig/debian/copyright
340 +++ amp-0.7.6/debian/copyright
342 +This package was Debianized by Ed Boraas <ed@debian.org>
344 +It was downloaded from ftp://ftp.rasip.fer.hr/pub/mpeg/
348 +This software can be used freely for any purpose. It can be distributed
349 +freely, as long as it is not sold commercially without permission from
350 +Tomislav Uzelac <tuzelac@rasip.fer.hr>. However, including this software
351 +on CD_ROMs containing other free software is explicitly permitted even
352 +when a modest distribution fee is charged for the CD, as long as this
353 +software is not a primary selling argument for the CD.
355 +Building derived versions of this software is permitted, as long as they
356 +are not sold commercially without permission from Tomislav Uzelac
357 +<tuzelac@rasip.fer.hr>. Any derived versions must be clearly marked as
358 +such, and must be called by a name other than amp. Any derived versions
359 +must retain this copyright notice.
361 +/* This license is itself copied from Tatu Ylonen's ssh package. It does
362 + * not mention being copyrighted itself :)
365 +THERE IS NO WARRANTY FOR THIS PROGRAM - whatsoever. You use it entirely
366 +at your risk, and neither Tomislav Uzelac, nor FER will be liable for
367 +any damages that might occur to your computer, software, etc. in
368 +consequence of you using this freeware program.
372 +<tuzelac@rasip.fer.hr>
373 --- amp-0.7.6.orig/debian/rules
374 +++ amp-0.7.6/debian/rules
377 +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
379 +# Uncomment this to turn on verbose mode.
380 +#export DH_VERBOSE=1
386 + ./configure --prefix=/usr --enable-realtime
400 +# Build architecture-independent files here.
402 +# We have nothing to do by default.
404 +# Build architecture-dependent files here.
405 +binary-arch: build amp
411 + dh_installdirs usr/bin usr/share/man/man1
412 + # Add here commands to install the files into debian/tmp
413 + cp amp debian/tmp/usr/bin
414 + cp amp.1 debian/tmp/usr/share/man/man1
415 + dh_installdocs README
416 + dh_installchangelogs
420 +# chmod u+s debian/tmp/usr/bin/amp
430 + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
432 +binary: binary-indep binary-arch
433 +.PHONY: build clean binary-indep binary-arch binary