kill the reposition handler in struct audio_format_handler
authorAndre Noll <maan@systemlinux.org>
Sun, 4 Mar 2007 20:35:44 +0000 (21:35 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 4 Mar 2007 20:35:44 +0000 (21:35 +0100)
All three audio format handlers provided only a dummy function. Kill
these as well.

NEWS
aac_afh.c
afh.h
mp3_afh.c
ogg_afh.c
vss.c

diff --git a/NEWS b/NEWS
index 429cd34a1796e0e6d34b63e28b2e2e123109631b..2980a559edfabece97d38b13e5d6b08ca4d706aa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,15 @@ NEWS
 0.?.? (to be announced) "neural discharge"
 ------------------------------------------
 
 0.?.? (to be announced) "neural discharge"
 ------------------------------------------
 
+The main change in this release is the major audio format handler
+cleanup which removes some similar/duplicate code and makes it easier
+to implement plugins for other audio formats. Of course, the usual mix
+of other improvements/changes/bugfixes also made it into the release.
+
+       - simplified audio format handlers (some of the handling functions
+         were moved one layer up to the virtual streaming system).
+       - repositioning of mp3 streams is much faster, in particular for
+       - jumping near the end of large mp3 files.
        - permission flags DB_READ,DB_WRITE have been renamed to AFS_READ
          and AFS_WRITE.
        - fix a bug in para_filter that caused decoding of aac files
        - permission flags DB_READ,DB_WRITE have been renamed to AFS_READ
          and AFS_WRITE.
        - fix a bug in para_filter that caused decoding of aac files
index 338b7827caf1d8d5a4399214c6c9dff92aaa77c3..e5ee2eef9520ea57631a6b6f112434de87ffee29 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -193,14 +193,6 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames,
        return 1;
 }
 
        return 1;
 }
 
-/*
- * nothing to do as we'll seek to the correct offset in aac read_chunk() anyway
- */
-static int aac_reposition_stream(__a_unused long unsigned request)
-{
-       return 1;
-}
-
 static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
 {
        int ret;
 static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
 {
        int ret;
@@ -238,7 +230,6 @@ static const char* aac_suffixes[] = {"m4a", "mp4", NULL};
 void aac_afh_init(struct audio_format_handler *p)
 {
        af = p;
 void aac_afh_init(struct audio_format_handler *p)
 {
        af = p;
-       af->reposition_stream = aac_reposition_stream;
        af->get_file_info = aac_get_file_info,
        af->read_chunk = aac_read_chunk;
        af->close_audio_file = aac_close_audio_file;
        af->get_file_info = aac_get_file_info,
        af->read_chunk = aac_read_chunk;
        af->close_audio_file = aac_close_audio_file;
diff --git a/afh.h b/afh.h
index 403b7a55e2e62ade3b8a97a1cb2ec2c1bdc06fa4..0ead11e0e997879a6e4ed98cc05770871cb3917f 100644 (file)
--- a/afh.h
+++ b/afh.h
@@ -102,14 +102,6 @@ struct audio_format_handler {
         * for closing the file handle. It is assumed to succeed.
        */
        void (*close_audio_file)(void);
         * for closing the file handle. It is assumed to succeed.
        */
        void (*close_audio_file)(void);
-       /**
-        * jump to another position in the current audio file
-        *
-        * This is called if a client issued the ff or jmp command with \a request
-        * being the number of the next chunk that should be sent out. Must return a
-        * positive value on success and a negative value on errors.
-       */
-       int (*reposition_stream)(long unsigned request);
        /**
         * function responsible for reading one data chunk.
         *
        /**
         * function responsible for reading one data chunk.
         *
index 4ed134fa1bc1f62d6be22f747d664adfdc6c5101..6850cbd83b8f8bee770aafb43a4ee984af5d7956 100644 (file)
--- a/mp3_afh.c
+++ b/mp3_afh.c
@@ -461,11 +461,6 @@ static int mp3_get_file_info(FILE *audio_file, char *info_str,
        return 1;
 }
 
        return 1;
 }
 
-static int mp3_reposition_stream(__a_unused long unsigned new_frame)
-{
-       return 1;
-}
-
 static char *mp3_read_chunk(long unsigned current_chunk, ssize_t *len)
 {
        int ret;
 static char *mp3_read_chunk(long unsigned current_chunk, ssize_t *len)
 {
        int ret;
@@ -518,7 +513,6 @@ void mp3_init(struct audio_format_handler *p)
 {
        af = p;
        af->get_file_info = mp3_get_file_info;
 {
        af = p;
        af->get_file_info = mp3_get_file_info;
-       af->reposition_stream = mp3_reposition_stream;
        af->read_chunk = mp3_read_chunk;
        af->close_audio_file = mp3_close_audio_file;
        af->get_header_info = NULL;
        af->read_chunk = mp3_read_chunk;
        af->close_audio_file = mp3_close_audio_file;
        af->get_header_info = NULL;
index 81f5ac1ae8c0b0a1e6496fe1470be3a43c0023f3..b5ecc4b0f3ebc96ec5459d3e7a7e59c3ce5326f9 100644 (file)
--- a/ogg_afh.c
+++ b/ogg_afh.c
@@ -272,11 +272,6 @@ err:
        return ret;
 }
 
        return ret;
 }
 
-static int ogg_reposition_stream(__a_unused long unsigned new_frame)
-{
-       return 1;
-}
-
 static char *ogg_read_chunk(long unsigned current_chunk, ssize_t *len)
 {
        int ret;
 static char *ogg_read_chunk(long unsigned current_chunk, ssize_t *len)
 {
        int ret;
@@ -324,7 +319,6 @@ static const char* ogg_suffixes[] = {"ogg", NULL};
 void ogg_init(struct audio_format_handler *p)
 {
        af = p;
 void ogg_init(struct audio_format_handler *p)
 {
        af = p;
-       af->reposition_stream = ogg_reposition_stream;
        af->get_file_info = ogg_get_file_info,
        af->read_chunk = ogg_read_chunk;
        af->close_audio_file = ogg_close_audio_file;
        af->get_file_info = ogg_get_file_info,
        af->read_chunk = ogg_read_chunk;
        af->close_audio_file = ogg_close_audio_file;
diff --git a/vss.c b/vss.c
index b34703de5bd8b8fb46a99a87587c77f86e0ca617..133ed19fa833f467137a94378180173defec4df1 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -482,8 +482,6 @@ again:
                }
                mmd->chunks_sent = 0;
        }
                }
                mmd->chunks_sent = 0;
        }
-       if (af && vss_repos() && mmd->current_chunk != mmd->repos_request)
-               af->reposition_stream(mmd->repos_request);
        if (vss_repos()) {
                mmd->new_vss_status_flags &= ~(VSS_REPOS);
                mmd->current_chunk = mmd->repos_request;
        if (vss_repos()) {
                mmd->new_vss_status_flags &= ~(VSS_REPOS);
                mmd->current_chunk = mmd->repos_request;