Skip to content

Commit

Permalink
Merge ddnet#4643
Browse files Browse the repository at this point in the history
4643: Disallow start_video outside of video player (fixes ddnet#4642) r=heinrich5991 a=def-

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
  • Loading branch information
bors[bot] and def- authored Jan 28, 2022
2 parents 7b4b44d + 1cf377f commit 62619fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Whether to enable the autoupdater. Packagers may want to disable this for their
Whether to enable client compilation. If set to OFF, DDNet will not depend on Curl, Freetype, Ogg, Opus, Opusfile, and SDL2. Default value is ON.

* **-DVIDEORECORDER=[ON|OFF]** <br>
Whether to add video recording support using FFmpeg to the client. You can use command `start_video` and `stop_video` to start and stop conversion from demo to mp4. This feature is currently experimental and not enabled by default.
Whether to add video recording support using FFmpeg to the client. Default value is OFF.

Dependencies needed on debian: `libx264-dev libavfilter-dev libavdevice-dev libavformat-dev libavcodec-extra libavutil-dev`

Expand Down
3 changes: 3 additions & 0 deletions src/engine/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3393,7 +3393,10 @@ void CClient::Con_StartVideo(IConsole::IResult *pResult, void *pUserData)
CClient *pSelf = (CClient *)pUserData;

if(pSelf->State() != IClient::STATE_DEMOPLAYBACK)
{
pSelf->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "videorecorder", "Can not start videorecorder outside of demoplayer.");
return;
}

if(!IVideo::Current())
{
Expand Down

0 comments on commit 62619fd

Please sign in to comment.