]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/osx_overhaul'
authorAndre Noll <maan@systemlinux.org>
Sat, 6 Aug 2011 12:32:30 +0000 (14:32 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 6 Aug 2011 12:35:29 +0000 (14:35 +0200)
1  2 
NEWS
audiod.c
audiod_command.c

diff --combined NEWS
index c6c2e4dbd741954bd344d5b240e7ba98851ff7e8,57ef197ba3e9dbba332ec208c43d90f48cfd5040..5105798f57fabc447fdc2c3630cb8363a6c7486b
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -6,7 -6,6 +6,8 @@@
          writers is now treated as a regular expression. This allows
          to replace 5 lines in the config file (one for each audio
          format) by one single line. See the manual for details.
 +      - Compiles cleanly also with llvm/clang.
++      - Rewrite of the osx writer (output plugin for Mac OS).
  
  --------------------------------------
  0.4.7 (2011-06-01) "infinite rollback"
diff --combined audiod.c
index 6e5efd64ed38f95181faa8cb1ce1a8dadb7483e4,eff58fda1b7ead6c327594afb60165a1bfde4fb1..c7998cdb7d02259b4e4da84353a2fdade8ec5584
+++ b/audiod.c
@@@ -289,7 -289,7 +289,7 @@@ out
                length / 60,
                length % 60
        );
-       PARA_DEBUG_LOG("slot %d: %s\n", slot_num, msg);
+       //PARA_DEBUG_LOG("slot %d: %s\n", slot_num, msg);
        return msg;
  empty:
        return para_strdup(NULL);
@@@ -1048,6 -1048,7 +1048,6 @@@ static void close_stat_pipe(void
  {
        if (!stat_task->ct)
                return;
 -      btr_free_node(stat_task->ct->btrn);
        client_close(stat_task->ct);
        stat_task->ct = NULL;
        clear_and_dump_items();
diff --combined audiod_command.c
index 0f7aa7e625ffcd0c7274f16e184f308b0322ceab,a0d0229d6973566296f0fc18b1aa987aacfd4c98..1c22f58b3eea76d91d89af50196c0fbed7c8ab31
@@@ -120,22 -120,24 +120,22 @@@ void stat_client_write_item(int item_nu
        struct para_buffer pb = {.flags = 0};
        struct para_buffer pfpb = {.flags = PBF_SIZE_PREFIX};
        const uint64_t one = 1;
 +      char *msg = stat_item_values[item_num];
 +      struct para_buffer *b;
  
        list_for_each_entry_safe(sc, tmp, &client_list, node) {
                int fd = sc->fd, ret;
  
                if (!((one << item_num) & sc->item_mask))
                        continue;
 -              if (write_ok(fd) > 0) {
 -                      struct para_buffer *b =
 -                              (sc->flags & SCF_PARSER_FRIENDLY)? &pfpb : &pb;
 -                      char *msg = stat_item_values[item_num];
 -                      if (!b->buf)
 -                              WRITE_STATUS_ITEM(b, item_num, "%s\n",
 -                                      msg? msg : "");
 -                      ret = write(fd, b->buf, b->offset);
 -                      if (ret == b->offset)
 -                              continue;
 -              }
 -              /* write error or fd not ready for writing */
 +              b = (sc->flags & SCF_PARSER_FRIENDLY)? &pfpb : &pb;
 +              if (!b->buf)
 +                      (void)WRITE_STATUS_ITEM(b, item_num, "%s\n",
 +                              msg? msg : "");
 +              ret = write(fd, b->buf, b->offset);
 +              if (ret == b->offset)
 +                      continue;
 +              /* write error or short write */
                close(fd);
                num_clients--;
                PARA_INFO_LOG("deleting client on fd %d\n", fd);
        }
        free(pb.buf);
        free(pfpb.buf);
 -//    if (num_clients)
 -//            PARA_DEBUG_LOG("%d client(s)\n", num_clients);
  }
  
  /**
@@@ -194,7 -198,7 +194,7 @@@ static int get_play_time_slot_num(void
        FOR_EACH_SLOT(i) {
                struct slot_info *s = &slot[i];
                struct timeval wstime;
-               if (!s->wns)
+               if (!s->wns || !s->wns[0].btrn)
                        continue;
                btr_get_node_start(s->wns[0].btrn, &wstime);
                if (oldest_slot >= 0 && tv_diff(&wstime, &oldest_wstime, NULL) > 0)
@@@ -303,9 -307,6 +303,9 @@@ int com_stat(int fd, int argc, char **a
        const uint64_t one = 1;
        struct para_buffer b = {.flags = 0};
  
 +      ret = mark_fd_nonblocking(fd);
 +      if (ret < 0)
 +              return ret;
        for (i = 1; i < argc; i++) {
                const char *arg = argv[i];
                if (arg[0] != '-')
                char *item = stat_item_values[i];
                if (!((one << i) & mask))
                        continue;
 -              WRITE_STATUS_ITEM(&b, i, "%s\n", item? item : "");
 +              (void)WRITE_STATUS_ITEM(&b, i, "%s\n", item? item : "");
        }
        ret = client_write(fd, b.buf);
        if (ret >= 0)