update server/WebApi.cpp.

This commit is contained in:
Leon 2022-08-08 09:58:17 +00:00 committed by Gitee
parent 143580d780
commit bc7671cfb3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved. * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
* *
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit). * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
@ -357,6 +357,7 @@ Value makeMediaSourceJson(MediaSource &media){
} }
case TrackVideo : { case TrackVideo : {
auto video_track = dynamic_pointer_cast<VideoTrack>(track); auto video_track = dynamic_pointer_cast<VideoTrack>(track);
video_track->flush();
obj["width"] = video_track->getVideoWidth(); obj["width"] = video_track->getVideoWidth();
obj["height"] = video_track->getVideoHeight(); obj["height"] = video_track->getVideoHeight();
obj["fps"] = round(video_track->getVideoFps()); obj["fps"] = round(video_track->getVideoFps());