X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=38f47fd804c4d00594c58b8f9104538449f026f6;hp=e48708a30398a99915fcf4f704932e3144392989;hb=1709cc8f8a54429441f8f83c38146e667133c727;hpb=69ba28198b553ab8f3b88116ebccfcec98c1c151 diff --git a/aft.c b/aft.c index e48708a3..38f47fd8 100644 --- a/aft.c +++ b/aft.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "para.h" #include "error.h" @@ -738,11 +739,11 @@ static void get_duration_buf(int seconds, char *buf, struct ls_options *opts) if (!hours) { /* m:ss or mm:ss */ max_width = opts->mode == LS_MODE_LONG? opts->widths.duration_width : 4; - sprintf(buf, "%*u:%02u", max_width - 3, mins, seconds % 60); + sprintf(buf, "%*u:%02d", max_width - 3, mins, seconds % 60); } else { /* more than one hour => h:mm:ss, hh:mm:ss, hhh:mm:ss, ... */ max_width = opts->mode == LS_MODE_LONG? opts->widths.duration_width : 7; - sprintf(buf, "%*u:%02u:%02u", max_width - 6, hours, mins, + sprintf(buf, "%*u:%02u:%02d", max_width - 6, hours, mins, seconds % 60); } } @@ -876,14 +877,14 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts, para_printf(b, "%s " /* attributes */ "%*u " /* amp */ - "%*d " /* image_id */ - "%*d " /* lyrics_id */ - "%*d " /* bitrate */ + "%*u " /* image_id */ + "%*u " /* lyrics_id */ + "%*u " /* bitrate */ "%*s " /* audio format */ - "%*d " /* frequency */ - "%d " /* channels */ + "%*u " /* frequency */ + "%u " /* channels */ "%s " /* duration */ - "%*d " /* num_played */ + "%*u " /* num_played */ "%s " /* last_played */ "%s\n", /* path */ att_buf, @@ -930,7 +931,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts, WRITE_STATUS_ITEM(b, SI_SECONDS_TOTAL, "%" PRIu32 "\n", afhi->seconds_total); WRITE_STATUS_ITEM(b, SI_LAST_PLAYED, "%s\n", last_played_time); - WRITE_STATUS_ITEM(b, SI_NUM_PLAYED, "%d\n", afsi->num_played); + WRITE_STATUS_ITEM(b, SI_NUM_PLAYED, "%u\n", afsi->num_played); WRITE_STATUS_ITEM(b, SI_AMPLIFICATION, "%u\n", afsi->amp); WRITE_STATUS_ITEM(b, SI_CHUNK_TIME, "%lu\n", tv2ms(&afhi->chunk_tv)); WRITE_STATUS_ITEM(b, SI_NUM_CHUNKS, "%" PRIu32 "\n", @@ -1410,10 +1411,14 @@ int com_ls(struct command_context *cc) return -E_AFT_SYNTAX; } } - if (!strcmp(arg, "-p")) { + if (!strcmp(arg, "-p") || !strcmp(arg, "-F")) { flags |= LS_FLAG_FULL_PATH; continue; } + if (!strcmp(arg, "-b")) { + flags &= ~LS_FLAG_FULL_PATH; + continue; + } if (!strcmp(arg, "-a")) { flags |= LS_FLAG_ADMISSIBLE_ONLY; continue; @@ -2637,7 +2642,7 @@ static int aft_open(const char *dir) if (ret >= 0) { unsigned num; osl_get_num_rows(audio_file_table, &num); - PARA_INFO_LOG("audio file table contains %d files\n", num); + PARA_INFO_LOG("audio file table contains %u files\n", num); return ret; } PARA_NOTICE_LOG("failed to open audio file table\n");