- store_player_pid(q->id, pid);
- xclose(lfd);
- setpgid(pid, pid);
- ev_child(ev, pid, 0, player_finished, q);
- D(("player subprocess ID %lu", (unsigned long)pid));
+ /* Back in disorderd (child was created) */
+ /* This track is prepared. (Non-raw tracks are by implication prepared as
+ * soon as they are playing, but really the question doesn't make much sense
+ * for them.) */
+ q->prepared = 1;
+ if(lfd != -1)
+ xclose(lfd);
+ /* Set the child's process group ID.
+ *
+ * But wait, didn't we already set it in the child? Yes, but it's possible
+ * that we'll need to address it by process group ID before it gets that far,
+ * so we set it here too. One or the other may fail but as long as one
+ * succeeds that's fine.
+ */
+ setpgid(q->pid, q->pid);
+ /* Ask the event loop to tell us when the child terminates */
+ ev_child(ev, q->pid, 0, player_finished, q);
+ D(("player subprocess ID %lu", (unsigned long)q->pid));