#include <sys/ioctl.h>
#include "config.h"
+#include "activity_monitor.h"
#ifdef CONFIG_OPENSSL
#include <openssl/md5.h>
if (conn->player_thread)
warn("Connection %d: RECORD: Duplicate RECORD message -- ignored", conn->connection_number);
else {
+ activity_monitor_signify_activity(1);
player_prepare_to_play(conn);
player_play(conn); // the thread better be 0
}
conn->ap2_rate = rate;
if ((rate & 1) != 0) {
debug(2, "Connection %d: Start playing.", conn->connection_number);
+ activity_monitor_signify_activity(1);
conn->ap2_play_enabled = 1;
} else {
debug(2, "Connection %d: Stop playing.", conn->connection_number);
+ activity_monitor_signify_activity(0);
conn->ap2_play_enabled = 0;
// not sure this is needed yet
// reset_anchor_info(conn); // needed if the player resumes
if (streams) {
// we are being asked to close a stream
player_stop(conn);
+ activity_monitor_signify_activity(0); // inactive, and should be after command_stop()
if (conn->session_key) {
free(conn->session_key);
conn->session_key = NULL;
"TEARDOWN: synchronously terminating the player thread of RTSP conversation thread %d (2).",
conn->connection_number);
player_stop(conn);
+ activity_monitor_signify_activity(0); // inactive, and should be after command_stop()
debug(3, "TEARDOWN: successful termination of playing thread of RTSP conversation thread %d.",
conn->connection_number);
} else {
ptp_send_control_message_string(conn->ap2_timing_peer_list_message);
else
debug(1, "No timing peer list!");
-
+ activity_monitor_signify_activity(1);
player_prepare_to_play(conn);
player_play(conn);
// hack.
conn->max_frames_per_packet = 352; // number of audio frames per packet.
- conn->input_rate = 44100;
+ conn->input_rate = 44100; // we are stuck with this for the moment.
conn->input_num_channels = 2;
conn->input_bit_depth = 16;
conn->input_bytes_per_frame = conn->input_num_channels * ((conn->input_bit_depth + 7) / 8);
-
+ activity_monitor_signify_activity(1);
player_prepare_to_play(
conn); // get capabilities of DAC before creating the buffered audio thread
plist_dict_set_item(stream0dict, "audioBufferSize",
plist_new_uint(conn->ap2_audio_buffer_size));
+
+ // this should be cancelled by an activity_monitor_signify_activity(1)
+ // call in the SETRATEANCHORI handler, which should come up right away
+ activity_monitor_signify_activity(0);
+
player_play(conn);
conn->rtp_running = 1; // hack!
debug(3, "Connection %d: rtsp_conversation_thread_func_cleanup_function called.",
conn->connection_number);
- if (conn->player_thread)
+ if (conn->player_thread) {
player_stop(conn);
+ activity_monitor_signify_activity(0); // inactive, and should be after command_stop()
+ }
debug(3, "Connection %d terminating:Closing timing, control and audio sockets...",
conn->connection_number);