diff --git a/lib/http_handlers.h b/lib/http_handlers.h index e8fa3c1..383a071 100644 --- a/lib/http_handlers.h +++ b/lib/http_handlers.h @@ -179,6 +179,7 @@ http_handler_set_property(raop_conn_t *conn, */ airplay_video_t *airplay_video = (airplay_video_t *) hls_get_current_video(raop); + assert(airplay_video); if (!strcmp(property, "selectedMediaArray")) { /* verify that this request contains a binary plist*/ char *header_str = NULL; @@ -467,6 +468,7 @@ http_handler_action(raop_conn_t *conn, http_request_t *request, http_response_t raop_t *raop = conn->raop; airplay_video_t *airplay_video = (airplay_video_t *) hls_get_current_video(raop); + assert(airplay_video); bool data_is_plist = false; plist_t req_root_node = NULL; uint64_t uint_val = 0; @@ -963,7 +965,8 @@ http_handler_hls(raop_conn_t *conn, http_request_t *request, http_response_t *r free (header_str); return; } - airplay_video_t *airplay_video = (airplay_video_t *) hls_get_current_video(raop); + airplay_video_t *airplay_video = (airplay_video_t *) hls_get_current_video(raop); + assert(airplay_video); if (!strcmp(url, "/master.m3u8")){ char * master_playlist = get_master_playlist(airplay_video); if (master_playlist) { diff --git a/lib/raop_handlers.h b/lib/raop_handlers.h index 2ba264a..eac243f 100644 --- a/lib/raop_handlers.h +++ b/lib/raop_handlers.h @@ -946,6 +946,7 @@ raop_handler_setup(raop_conn_t *conn, switch (type) { case 110: { // Mirroring + raop_destroy_airplay_video(raop, -1); //cleanup any hls data still present when mirror video starts unsigned short dport = raop->mirror_data_lport; plist_t stream_id_node = plist_dict_get_item(req_stream_node, "streamConnectionID"); uint64_t stream_connection_id = 0; diff --git a/uxplay.cpp b/uxplay.cpp index 3b68a1c..420972f 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -3225,7 +3225,6 @@ int main (int argc, char *argv[]) { if (use_video && (close_window || preserve_connections)) { video_renderer_destroy(); if (!preserve_connections) { - raop_destroy_airplay_video(raop, -1); url.erase(); raop_remove_known_connections(raop); }