GCC Code Coverage Report


Directory: ./
File: mediaoutput/MediaOutputBase.cpp
Date: 2026-12-01 12:27:28
Exec Total Coverage
Lines: 31 44 70.5%
Functions: 4 10 40.0%
Branches: 11 16 68.8%

Line Branch Exec Source
1 /*
2 * This file is part of the Falcon Player (FPP) and is Copyright (C)
3 * 2013-2022 by the Falcon Player Developers.
4 *
5 * The Falcon Player (FPP) is free software, and is covered under
6 * multiple Open Source licenses. Please see the included 'LICENSES'
7 * file for descriptions of what files are covered by each license.
8 *
9 * This source file is covered under the LGPL v2.1 as described in the
10 * included LICENSE.LGPL file.
11 */
12
13 #include "fpp-pch.h"
14
15 #include <sys/time.h>
16 #include <sys/wait.h>
17 #include <errno.h>
18
19 #include <cmath>
20
21 #include "../log.h"
22 #include "../settings.h"
23
24 #include "MediaOutputBase.h"
25
26 2182 MediaOutputBase::MediaOutputBase(void) {
27
1/2
✓ Branch 0 taken 2182 times.
✗ Branch 1 not taken.
2182 LogDebug(VB_MEDIAOUT, "MediaOutputBase::MediaOutputBase()\n");
28
29
3/4
✓ Branch 0 taken 2182 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2142 times.
✓ Branch 3 taken 40 times.
2182 if (getFPPmode() != REMOTE_MODE) {
30
1/2
✓ Branch 0 taken 2142 times.
✗ Branch 1 not taken.
2142 mediaOffsetMS = getSettingInt("globalMediaOffset", 0);
31 2142 mediaOffset = (float)mediaOffsetMS * 0.001;
32 }
33 2182 }
34
35 4210 MediaOutputBase::~MediaOutputBase() {
36 4210 LogDebug(VB_MEDIAOUT, "MediaOutputBase::~MediaOutputBase()\n");
37 4210 Close();
38 4210 }
39
40 /*
41 *
42 */
43 ✗ int MediaOutputBase::Start(int msTime) {
44 ✗ return 0;
45 }
46
47 /*
48 *
49 */
50 ✗ int MediaOutputBase::Stop(void) {
51 ✗ return 0;
52 }
53
54 /*
55 *
56 */
57 ✗ int MediaOutputBase::Process(void) {
58 ✗ return 0;
59 }
60
61 /*
62 *
63 */
64 2105 int MediaOutputBase::Close(void) {
65 2105 LogDebug(VB_MEDIAOUT, "MediaOutputBase::Close\n");
66
67 2105 return 1;
68 }
69
70 /*
71 *
72 */
73 ✗ int MediaOutputBase::AdjustSpeed(float masterPos) {
74 ✗ return 1;
75 }
76
77 /*
78 *
79 */
80 ✗ void MediaOutputBase::SetVolume(int volume) {
81 ✗ }
82
83 /*
84 *
85 */
86 ✗ int MediaOutputBase::IsPlaying(void) {
87 ✗ return 0;
88 }
89
90 188842 void MediaOutputBase::setMediaElapsed(float curtime, float remaining) {
91 188842 float secs = curtime;
92 188842 float rem = remaining;
93
2/2
✓ Branch 0 taken 1830 times.
✓ Branch 1 taken 187012 times.
188842 if (mediaOffset > 0) {
94 1830 secs -= mediaOffset;
95 } else {
96 187012 rem -= mediaOffset;
97 }
98
2/2
✓ Branch 0 taken 467 times.
✓ Branch 1 taken 188375 times.
188842 if (secs < 0.0) {
99 467 secs = 0.0;
100 }
101
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 188842 times.
188842 if (rem < 0.0) {
102 ✗ rem = 0.0;
103 }
104 float elapsed, elapsedSub, remain, remainSub;
105 188842 elapsedSub = std::modf(secs, &elapsed) * 100;
106 188842 remainSub = std::modf(rem, &remain) * 100;
107
108
1/2
✓ Branch 0 taken 188842 times.
✗ Branch 1 not taken.
188842 std::lock_guard<std::mutex> lock(MediaOutputStatus::FieldsLock());
109 188842 m_mediaOutputStatus->mediaSeconds = secs;
110 188842 m_mediaOutputStatus->secondsElapsed = elapsed;
111 188842 m_mediaOutputStatus->subSecondsElapsed = elapsedSub;
112 188842 m_mediaOutputStatus->secondsRemaining = remain;
113 188842 m_mediaOutputStatus->subSecondsRemaining = remainSub;
114 188842 }
115