]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge commit 'remotes/meins/master'
authorAndre Noll <maan@systemlinux.org>
Fri, 14 Mar 2008 09:01:47 +0000 (10:01 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 14 Mar 2008 09:01:47 +0000 (10:01 +0100)
FEATURES
Makefile.in
NEWS
README
afh_common.c
afs.c
aft.c
configure.ac
error.h
osl.c
web/documentation.in.html

index 0151bb58b7038ba342ed41e7e7d8fdea4f357d4d..100a49c5c58fa7873373590832312fde8c5f7dd9 100644 (file)
--- a/FEATURES
+++ b/FEATURES
@@ -11,6 +11,7 @@ Features
        * Volume normalizer
        * Stream grabbing at any point in the filter chain
        * Stand-alone command line receiver/decoder/normalizer/player
+       * Stand-alone audio format handler utility
        * Sophisticated audio file selector
        * Small memory footprint
        * Command line interface for easy scripting in high-level languages
index 7ee2132b0d83f2cd895ff6fdbab00e941140a6dd..3d3e5f7171f5449b99ada91ce786fe882298f975 100644 (file)
@@ -53,7 +53,7 @@ CPPFLAGS += @ncurses_cppflags@
 CPPFLAGS += @arch_cppflags@
 
 BINARIES = para_server para_client para_audioc para_recv \
-       para_filter para_write para_fsck @extra_binaries@
+       para_filter para_write para_fsck para_afh @extra_binaries@
 man_binaries := $(BINARIES)
 man_pages := $(patsubst %, man/man1/%.1, $(man_binaries))
 man_pages_in := $(patsubst %, web/%.man.in.html, $(man_binaries))
@@ -116,6 +116,7 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
        case $< in client.ggo) O="--unamed-opts=command";; \
                audioc.ggo) O="--unamed-opts=command";; \
                fsck.ggo) O="--unamed-opts=table";; \
+               afh.ggo) O="--unamed-opts=audio_file";; \
        esac; \
        if test $< != fsck.ggo; then O="$$O --conf-parser "; fi; \
        gengetopt $$O \
@@ -214,6 +215,9 @@ para_fsck: @fsck_objs@
 para_write: @write_objs@
        $(CC) $(LDFLAGS) -o $@ @write_objs@ @write_ldflags@
 
+para_afh: @afh_objs@
+       $(CC) $(LDFLAGS) -o $@ @afh_objs@ @afh_ldflags@
+
 clean:
        rm -f *.o $(BINARIES)
        rm -rf man
diff --git a/NEWS b/NEWS
index 668d8dab3896c295e6bc21babe007935ed8a8458..4cc2d68d88a9d79de80d17408ab64061610c88cb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ NEWS
 0.3.2 (to be announced) "probabilistic parity"
 ----------------------------------------------
 
+       - new ls option: -lc (list chunk table)
+       - new executable: para_afh, the stand-alone audio file handler tool
+
 ---------------------------------------
 0.3.1 (2008-02-23) "liquid interaction"
 ---------------------------------------
diff --git a/README b/README
index 7a564f9214318aaf5e15bc4da8f61d1a26cc35d0..0e1e5cb4df4a5853e340c4fb96cb2af05d6ca6db 100644 (file)
--- a/README
+++ b/README
@@ -96,6 +96,17 @@ para_filter does not depend on other parts of paraslash, so it can
 be used as a stand-alone command line tool for audio decoding and
 volume normalization.
 
+--------
+para_afh
+--------
+
+A small stand-alone program that prints tech info about the given
+audio file to stdout. It can be instructed to print a "chunk table",
+an array of offsets within the audio file. This allows third-party
+streaming software that is unaware of the particular audio format
+to send complete frames in real time. Currently, mp3, ogg vorbis and
+aac are supported.
+
 ----------
 para_write
 ----------
index e71fca1119d8ea5d292ef2ae34515d4fcfa693d0..3fa88f14e7015c42b4c2adadaf1977ccc790f774 100644 (file)
@@ -119,7 +119,7 @@ int guess_audio_format(const char *name)
                        return i;
                }
        }
-       return -E_BAD_AUDIO_FILE_SUFFIX;
+       return -1;
 }
 
 /**
diff --git a/afs.c b/afs.c
index 6210358c4ef075ed4bb13680028b27f1ec430123..05c2c21367e93f851cf4ac6d89deece65ac23d06 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -148,7 +148,7 @@ struct callback_result {
  * \param result Callback result will be stored here.
  *
  * This function creates a shared memory area, copies the buffer pointed to by
- * query to that area and notifies the afs process that \a f should be
+ * \a query to that area and notifies the afs process that \a f should be
  * called ASAP.
  *
  * \return Negative, on errors, the return value of the callback function
diff --git a/aft.c b/aft.c
index 0efd285c2eb716df2aeeb47e4dfd06aa1d293e5f..5f5548f03dc9e71989fddf41acb4cb16b568910c 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -835,13 +835,13 @@ static int print_chunk_table(struct ls_data *d, struct para_buffer *b)
                AFTCOL_CHUNKS, &chunk_table_obj);
        if (ret < 0)
                return ret;
-       buf = chunk_table_obj.data;
        para_printf(b, "%s\n"
                "chunk_time: %lu:%lu\nchunk_offsets: ",
                d->path,
                (long unsigned) d->afhi.chunk_tv.tv_sec,
                (long unsigned) d->afhi.chunk_tv.tv_usec
        );
+       buf = chunk_table_obj.data;
        for (i = 0; i <= d->afhi.chunks_total; i++)
                para_printf(b, "%u ",
                        (unsigned) read_u32(buf + 4 * i));
index ff27cb41d4d1314c0f0edc6eaf3df5cd0902a075..c435e371c3ec511637a24494bf39b2b0a79dbafa 100644 (file)
@@ -79,12 +79,12 @@ AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
        [AC_MSG_ERROR([function not found, cannot live without it])])
 
 all_errlist_objs="server mp3_afh afh_common vss command net string signal time
-daemon stat crypt http_send close_on_fork ipc acl
+daemon stat crypt http_send close_on_fork ipc acl afh
 dccp_send fd user_list chunk_queue afs osl aft mood score attribute blob ringbuffer
 playlist sha1 rbtree sched audiod grab_client filter_chain wav compress
 http_recv dccp_recv recv_common write_common file_write audiod_command
 client_common recv stdout filter stdin audioc write client fsck exec send_common"
-all_executables="server audiod recv filter audioc write client fsck"
+all_executables="server recv filter audioc write client fsck afh"
 
 recv_cmdline_objs="recv.cmdline http_recv.cmdline dccp_recv.cmdline"
 recv_errlist_objs="http_recv recv_common recv time string net dccp_recv
@@ -113,6 +113,10 @@ audiod_errlist_objs="audiod signal string daemon stat net
 audiod_ldflags=""
 audiod_audio_formats=""
 
+afh_cmdline_objs="afh.cmdline"
+afh_errlist_objs="afh string fd mp3_afh afh_common time"
+afh_ldflags=""
+
 server_cmdline_objs="server.cmdline server_command_list afs_command_list"
 server_errlist_objs="server afh_common mp3_afh vss command net string signal
        time daemon stat crypt http_send close_on_fork
@@ -315,6 +319,7 @@ if test "$have_ogg" = "yes"; then
        server_ldflags="$server_ldflags $oggvorbis_libs -logg -lvorbis -lvorbisfile"
        filter_ldflags="$filter_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
        audiod_ldflags="$audiod_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
+       afh_ldflags="$afh_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
 
        filter_cmdline_objs="$filter_cmdline_objs oggdec_filter.cmdline"
        audiod_cmdline_objs="$audiod_cmdline_objs oggdec_filter.cmdline"
@@ -322,6 +327,7 @@ if test "$have_ogg" = "yes"; then
        server_errlist_objs="$server_errlist_objs ogg_afh"
        filter_errlist_objs="$filter_errlist_objs oggdec"
        audiod_errlist_objs="$audiod_errlist_objs oggdec"
+       afh_errlist_objs="$afh_errlist_objs ogg_afh"
 
        audiod_audio_formats="ogg"
        server_audio_formats="$server_audio_formats ogg"
@@ -357,12 +363,14 @@ if test "$have_faad" = "yes"; then
        AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter)
        all_errlist_objs="$all_errlist_objs aac_common aacdec aac_afh"
        filter_errlist_objs="$filter_errlist_objs aacdec aac_common"
+       afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
        filter_filters="$filter_filters aacdec"
        audiod_errlist_objs="$audiod_errlist_objs aacdec aac_common"
        server_errlist_objs="$server_errlist_objs aac_afh aac_common"
        server_ldflags="$server_ldflags $faad_libs -lfaad"
        filter_ldflags="$filter_ldflags $faad_libs -lfaad"
        audiod_ldflags="$audiod_ldflags $faad_libs -lfaad"
+       afh_ldflags="$afh_ldflags $faad_libs -lfaad"
        audiod_audio_formats="$audiod_audio_formats aac"
        server_audio_formats="$server_audio_formats aac"
        filters="$filters aacdec"
@@ -414,6 +422,7 @@ else
 fi
 if test -n "$audiod_audio_formats"; then
        extras="$extras para_audiod"
+       all_executables="$all_executables audiod"
 else
        AC_MSG_WARN([can not build para_audiod (no supported audio formats)])
 fi
@@ -620,6 +629,7 @@ write_objs="$write_cmdline_objs $write_errlist_objs"
 client_objs="$client_cmdline_objs $client_errlist_objs"
 fsck_objs="$fsck_cmdline_objs $fsck_errlist_objs"
 audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs"
+afh_objs="$afh_cmdline_objs $afh_errlist_objs"
 
 AC_SUBST(recv_objs, add_dot_o($recv_objs))
 AC_SUBST(recv_ldflags, $recv_ldflags)
@@ -641,6 +651,11 @@ AC_SUBST(server_ldflags, $server_ldflags)
 AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
        objlist_to_errlist($server_errlist_objs), errors used by para_server)
 
+AC_SUBST(afh_objs, add_dot_o($afh_objs))
+AC_SUBST(afh_ldflags, $afh_ldflags)
+AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
+       objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
+
 AC_SUBST(write_objs, add_dot_o($write_objs))
 AC_SUBST(write_ldflags, $write_ldflags)
 AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
diff --git a/error.h b/error.h
index 55bd3ba6b7a698f3d9370c9b24af67411daa4a3e..415262d0c2fe7507efffbe710aab153ea431fb14 100644 (file)
--- a/error.h
+++ b/error.h
@@ -24,13 +24,20 @@ DEFINE_ERRLIST_OBJECT_ENUM;
 #define RINGBUFFER_ERRORS
 #define SCORE_ERRORS
 #define SHA1_ERRORS
-#define AFH_COMMON_ERRORS
 #define RBTREE_ERRORS
 #define RECV_ERRORS
 #define SEND_COMMON_ERRORS
 
 extern const char **para_errlist[];
 
+#define AFH_ERRORS \
+       PARA_ERROR(AFH_SYNTAX, "afh syntax error"), \
+
+
+#define AFH_COMMON_ERRORS \
+       PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \
+
+
 #define ACL_ERRORS \
        PARA_ERROR(ACL_PERM, "access denied by acl"), \
 
@@ -302,8 +309,6 @@ extern const char **para_errlist[];
 
 
 #define VSS_ERRORS \
-       PARA_ERROR(BAD_AUDIO_FILE_SUFFIX, "unknown suffix"), \
-       PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \
        PARA_ERROR(CHUNK, "unable to get chunk"), \
        PARA_ERROR(NOFD, "did not receive open fd from afs"), \
 
diff --git a/osl.c b/osl.c
index 2519228890bc2c25f1b82da6887585afe42840ae..c5f48945ee6ca88980ce67a7376d6b6eb21c4e89 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -168,8 +168,7 @@ out:
  * are passed to \a func. Directories for which the calling process has no
  * permissions to change to are silently ignored.
  *
- * \return On success, 1 is returned. Otherwise, this function returns a
- * negative value which indicates the kind of the error.
+ * \return Standard.
  */
 int for_each_file_in_dir(const char *dirname,
                int (*func)(const char *, const void *), const void *private_data)
index 4e84f446eb542ea8f11cf1466c97ecb6d28dcf59..a9d3e3a2b77f131604998ea2aba37e7462c892f2 100644 (file)
@@ -36,6 +36,7 @@
        [<a href="para_audiod.man.html">para_audiod</a>]
        [<a href="para_client.man.html">para_client</a>]
        [<a href="para_audioc.man.html">para_audioc</a>]
+       [<a href="para_afh.man.html">para_afh</a>]
        [<a href="para_fsck.man.html">para_fsck</a>]
        [<a href="para_recv.man.html">para_recv</a>]
        [<a href="para_filter.man.html">para_filter</a>]