From fc1cbf1a7fde3b2c7da319101445b464de05ee99 Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Mon, 12 Jun 2023 00:14:10 +0900 Subject: [PATCH] updated ss4s --- app/backend/stream/stream_media.c | 12 +++++++----- app/main.c | 4 ++-- third_party/ss4s | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/backend/stream/stream_media.c b/app/backend/stream/stream_media.c index d6c250a..1d1e442 100644 --- a/app/backend/stream/stream_media.c +++ b/app/backend/stream/stream_media.c @@ -58,6 +58,7 @@ stream_media_session_t *stream_media_create(stream_manager_t *manager) { media_session->manager = manager; media_session->lock = SDL_CreateMutex(); media_session->player = SS4S_PlayerOpen(); + SS4S_PlayerSetWaitAudioVideoReady(media_session->player, true); SS4S_GetVideoCapabilities(&media_session->video_cap); return media_session; @@ -123,7 +124,7 @@ const IHS_StreamVideoCallbacks *stream_media_video_callbacks() { static int audio_start(IHS_Session *session, const IHS_StreamAudioConfig *config, void *context) { (void) session; commons_log_info("Media", "Audio start. codec=%u, channels=%u, sampleRate=%u", config->codec, - config->channels, config->frequency); + config->channels, config->frequency); if (config->codec != IHS_StreamAudioCodecOpus) { return -1; } @@ -182,7 +183,8 @@ static int video_start(IHS_Session *session, const IHS_StreamVideoConfig *config } stream_media_session_t *media_session = (stream_media_session_t *) context; SDL_LockMutex(media_session->lock); - commons_log_info("Media", "Video start. codec=%u, width=%u, height=%u", config->codec, config->width, config->height); + commons_log_info("Media", "Video start. codec=%u, width=%u, height=%u", config->codec, config->width, + config->height); SS4S_VideoInfo info = { .codec = codec, .width = (int) config->width, @@ -219,7 +221,7 @@ static int video_submit(IHS_Session *session, IHS_Buffer *data, IHS_StreamVideoF } default: { commons_log_fatal("Media", "Unexpected video codec %s!!", - SS4S_VideoCodecName(media_session->video_info.codec)); + SS4S_VideoCodecName(media_session->video_info.codec)); abort(); } } @@ -230,8 +232,8 @@ static int video_submit(IHS_Session *session, IHS_Buffer *data, IHS_StreamVideoF if (dimension_parsed && (dimension.width != media_session->video_info.width || dimension.height != media_session->video_info.height)) { commons_log_info("Media", "Size change detected by NAL header. (%d*%d)=>(%d*%d)", - media_session->video_info.width, media_session->video_info.height, dimension.width, - dimension.height); + media_session->video_info.width, media_session->video_info.height, dimension.width, + dimension.height); media_session->video_info.width = dimension.width; media_session->video_info.height = dimension.height; SS4S_PlayerVideoSizeChanged(media_session->player, dimension.width, dimension.height); diff --git a/app/main.c b/app/main.c index 73ae5bd..4d14ae4 100644 --- a/app/main.c +++ b/app/main.c @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) { #if IHSPLAY_FEATURE_LIBCEC cec_sdl_ctx_t cec; - cec_sdl_init(&cec); + cec_sdl_init(&cec, "IHSplay"); #endif while (app->running) { @@ -181,7 +181,7 @@ static void process_events() { } static void logging_init() { - commons_logging_init(); + commons_logging_init("ihsplay"); lv_log_register_print_cb(app_lv_log); SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE); SDL_LogSetOutputFunction(app_sdl_log, NULL); diff --git a/third_party/ss4s b/third_party/ss4s index 04c947f..20096ba 160000 --- a/third_party/ss4s +++ b/third_party/ss4s @@ -1 +1 @@ -Subproject commit 04c947f7ccb687e54bdf6a44f2adc7ffc8f548b9 +Subproject commit 20096baa1c55944183f386ae8147db6441668fa8