]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
server: ls -l=c: Don't print chunk table in case of dynamic chunks.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 24 Jan 2023 18:57:33 +0000 (19:57 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 25 Jan 2023 12:50:57 +0000 (13:50 +0100)
The chunk table stored in the osl disk object of the paraslash
database is useless for audio formats which support dynamic chunks
(aac only). Omit this part of the ls output.

aft.c

diff --git a/aft.c b/aft.c
index afe8c49dd1d91854cb6112bbc6dea3ba3046734f..a15a1d2cc673326385a795e3d9900ddd0fb7cb37 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -800,6 +800,12 @@ static int print_chunk_table(struct ls_data *d, struct para_buffer *b)
        int ret, i;
        char *buf;
 
+       para_printf(b, "%s\nchunk_time: %lu:%lu\n", d->path,
+               (long unsigned) d->afhi.chunk_tv.tv_sec,
+               (long unsigned) d->afhi.chunk_tv.tv_usec
+       );
+       if (afh_supports_dynamic_chunks(d->afsi.audio_format_id))
+               return 0;
        ret = aft_get_row_of_hash(d->hash, &aft_row);
        if (ret < 0)
                return ret;
@@ -807,12 +813,7 @@ static int print_chunk_table(struct ls_data *d, struct para_buffer *b)
                AFTCOL_CHUNKS, &chunk_table_obj));
        if (ret < 0)
                return ret;
-       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
-       );
+       para_printf(b, "chunk_offsets: ");
        buf = chunk_table_obj.data;
        for (
                i = 0;