-
This patch only deals with initializing values properly.
From: Erik Hovland <erik@hovland.org>
---
libs/libmythtv/RingBuffer.cpp | 2 +
libs/libmythtv/ThreadedFileWriter.cpp | 4 +-
libs/libmythtv/cc708window.cpp | 2 +
libs/libmythtv/cc708window.h | 10 ++++++
libs/libmythtv/dsmccbiop.h | 22 ++++++++++---
libs/libmythtv/dvbdev/dvbci.cpp | 7 ++++
libs/libmythtv/fifowriter.cpp | 1 +
libs/libmythtv/frequencytables.h | 4 +-
libs/libmythtv/infostructs.h | 3 +-
libs/libmythtv/mpeg/tspacket.h | 2 +
libs/libmythtv/osdtypeteletext.cpp | 2 +
libs/libmythtv/osdxvmc.cpp | 12 +++++--
libs/libmythtv/osdxvmc.h | 2 -
libs/libmythtv/programdata.h | 4 ++
libs/libmythtv/signalmonitorvalue.h | 5 ++-
libs/libmythtv/ttfont.cpp | 54 +++++++++++++--------------------
libs/libmythtv/ttfont.h | 4 ++
libs/libmythtv/tv_play.h | 5 ++-
libs/libmythtv/vbitext/vbi.c | 2 +
libs/libmythtv/videooutbase.cpp | 1 +
libs/libmythtv/vsync.cpp | 9 +++---
21 files changed, 91 insertions(+), 66 deletions(-)
diff --git a/libs/libmythtv/RingBuffer.cpp b/libs/libmythtv/RingBuffer.cpp
index ed8cd2c..29fb26a 100644
a
|
b
|
void RingBuffer::UpdatePlaySpeed(float play_speed) |
531 | 531 | */ |
532 | 532 | void RingBuffer::CalcReadAheadThresh(void) |
533 | 533 | { |
534 | | uint estbitrate; |
| 534 | uint estbitrate = 0; |
535 | 535 | |
536 | 536 | pthread_rwlock_wrlock(&rwlock); |
537 | 537 | wantseek = false; |
-
diff --git a/libs/libmythtv/ThreadedFileWriter.cpp b/libs/libmythtv/ThreadedFileWriter.cpp
index 7cf289b..6d1904f 100644
a
|
b
|
ThreadedFileWriter::ThreadedFileWriter(const QString &fname, |
124 | 124 | mode(pmode), fd(-1), |
125 | 125 | // state |
126 | 126 | no_writes(false), flush(false), |
127 | | in_dtor(false), ignore_writes(false), |
128 | | tfw_min_write_size(0), |
| 127 | write_is_blocked(false), in_dtor(false), |
| 128 | ignore_writes(false), tfw_min_write_size(0), |
129 | 129 | // buffer position state |
130 | 130 | rpos(0), wpos(0), |
131 | 131 | written(0), |
-
diff --git a/libs/libmythtv/cc708window.cpp b/libs/libmythtv/cc708window.cpp
index 25af2b7..c3a2064 100644
a
|
b
|
const uint k708AttrOpacityTransparent = 3; |
101 | 101 | |
102 | 102 | CC708Window::CC708Window() |
103 | 103 | : priority(0), visible(0), |
104 | | anchor_point(0), |
| 104 | anchor_point(0), relative_pos(0), |
105 | 105 | anchor_vertical(0), anchor_horizontal(0), |
106 | 106 | row_count(0), column_count(0), |
107 | 107 | row_lock(0), column_lock(0), |
-
diff --git a/libs/libmythtv/cc708window.h b/libs/libmythtv/cc708window.h
index fcf0f23..ba191bb 100644
a
|
b
|
using namespace std; |
14 | 14 | class CC708CharacterAttribute |
15 | 15 | { |
16 | 16 | public: |
| 17 | CC708CharacterAttribute() |
| 18 | : pen_size(0), offset(0) |
| 19 | , text_tag(0), font_tag(0) |
| 20 | , edge_type(0), underline(0) |
| 21 | , italics(0), fg_color(0) |
| 22 | , fg_opacity(0), bg_color(0) |
| 23 | , bg_opacity(0), edge_color(0) {} |
17 | 24 | uint pen_size; |
18 | 25 | uint offset; |
19 | 26 | uint text_tag; |
… |
… |
class CC708CharacterAttribute |
60 | 67 | class CC708Pen |
61 | 68 | { |
62 | 69 | public: |
| 70 | CC708Pen() : row(0), column(0) {} |
63 | 71 | void SetPenStyle(uint style); |
64 | 72 | void SetAttributes(int pen_size, |
65 | 73 | int offset, int text_tag, int font_tag, |
… |
… |
class CC708Pen |
73 | 81 | attr.underline = underline; |
74 | 82 | attr.italics = italics; |
75 | 83 | } |
76 | | public: |
| 84 | |
77 | 85 | CC708CharacterAttribute attr; |
78 | 86 | |
79 | 87 | uint row; |
-
diff --git a/libs/libmythtv/dsmccbiop.h b/libs/libmythtv/dsmccbiop.h
index 25b15b4..c1a136f 100644
a
|
b
|
class BiopName |
46 | 46 | class BiopTap |
47 | 47 | { |
48 | 48 | public: |
49 | | BiopTap() { selector_data = NULL; } |
| 49 | BiopTap() : |
| 50 | id(0), use(0), |
| 51 | assoc_tag(0), selector_len(0), |
| 52 | selector_data(NULL) { } |
50 | 53 | ~BiopTap(); |
51 | 54 | |
52 | 55 | int Process(const unsigned char*); |
… |
… |
class BiopConnbinder |
73 | 76 | class BiopObjLocation |
74 | 77 | { |
75 | 78 | public: |
76 | | BiopObjLocation() { } |
| 79 | BiopObjLocation() : |
| 80 | component_tag(0), component_data_len(0), |
| 81 | version_major(0), version_minor(0) { } |
77 | 82 | ~BiopObjLocation() { } |
78 | 83 | |
79 | 84 | int Process(const unsigned char*); |
… |
… |
class ProfileBody |
96 | 101 | class ProfileBodyFull: public ProfileBody |
97 | 102 | { |
98 | 103 | public: |
99 | | ProfileBodyFull() { } |
| 104 | ProfileBodyFull() : |
| 105 | data_len(0), byte_order(0), |
| 106 | lite_components_count(0) { } |
100 | 107 | virtual ~ProfileBodyFull() { } |
101 | 108 | virtual int Process(const unsigned char *); |
102 | 109 | virtual DSMCCCacheReference *GetReference() |
… |
… |
class BiopIor |
154 | 161 | class BiopBinding |
155 | 162 | { |
156 | 163 | public: |
157 | | BiopBinding() : m_objinfo_len(0), m_objinfo(0) {} |
| 164 | BiopBinding() : m_binding_type(0), m_objinfo_len(0), m_objinfo(0) {} |
158 | 165 | ~BiopBinding(); |
159 | 166 | |
160 | 167 | int Process(const unsigned char *data); |
… |
… |
class ObjCarousel; |
171 | 178 | class BiopMessage |
172 | 179 | { |
173 | 180 | public: |
174 | | BiopMessage() : m_objinfo(NULL), m_objkind(NULL) {} |
| 181 | BiopMessage() : |
| 182 | m_version_major(0), m_version_minor(0), |
| 183 | m_message_size(0), m_objkind_len(0), |
| 184 | m_objinfo_len(0), m_objinfo(NULL), |
| 185 | m_objkind(NULL) {} |
175 | 186 | ~BiopMessage(); |
| 187 | |
176 | 188 | bool Process(DSMCCCacheModuleData *cachep, DSMCCCache *cache, |
177 | 189 | unsigned char *data, unsigned long *curp); |
178 | 190 | |
-
diff --git a/libs/libmythtv/dvbdev/dvbci.cpp b/libs/libmythtv/dvbdev/dvbci.cpp
index 0ab0d9f..b224700 100644
a
|
b
|
private: |
233 | 233 | uint8_t data[MAX_TPDU_SIZE]; |
234 | 234 | const uint8_t *GetData(const uint8_t *Data, int &Length); |
235 | 235 | public: |
236 | | cTPDU(void) { size = 0; } |
| 236 | cTPDU(void) { size = 0; memset(data, 0, sizeof(uint8_t) * MAX_TPDU_SIZE); } |
237 | 237 | cTPDU(uint8_t Slot, uint8_t Tcid, uint8_t Tag, int Length = 0, const uint8_t *Data = NULL); |
238 | 238 | uint8_t Slot(void) { return data[0]; } |
239 | 239 | uint8_t Tcid(void) { return data[1]; } |
… |
… |
cCiApplicationInformation::cCiApplicationInformation(int SessionId, cCiTransport |
904 | 904 | dbgprotocol("New Application Information (session id %d)\n", SessionId); |
905 | 905 | state = 0; |
906 | 906 | creationTime = time(NULL); |
| 907 | applicationType = 0; |
| 908 | applicationManufacturer = 0; |
| 909 | manufacturerCode = 0; |
907 | 910 | menuString = NULL; |
908 | 911 | } |
909 | 912 | |
… |
… |
cCiMenu::cCiMenu(cCiMMI *MMI, bool Selectable) |
1326 | 1329 | selectable = Selectable; |
1327 | 1330 | titleText = subTitleText = bottomText = NULL; |
1328 | 1331 | numEntries = 0; |
| 1332 | for (int i = 0; i < MAX_CIMENU_ENTRIES; i++) |
| 1333 | entries[i] = NULL; |
1329 | 1334 | } |
1330 | 1335 | |
1331 | 1336 | cCiMenu::~cCiMenu() |
-
diff --git a/libs/libmythtv/fifowriter.cpp b/libs/libmythtv/fifowriter.cpp
index 3f4a518..15addc2 100644
a
|
b
|
FIFOWriter::FIFOWriter(int count, bool sync) |
26 | 26 | { |
27 | 27 | num_fifos = count; |
28 | 28 | usesync = sync; |
| 29 | cur_id = -1; |
29 | 30 | maxblksize = new long[count]; |
30 | 31 | killwr = new int[count]; |
31 | 32 | fbcount = new int[count]; |
-
diff --git a/libs/libmythtv/frequencytables.h b/libs/libmythtv/frequencytables.h
index 6d74f43..83ff432 100644
a
|
b
|
class FrequencyTable |
74 | 74 | inversion(_inversion), bandwidth(_bandwidth), |
75 | 75 | coderate_hp(_coderate_hp), coderate_lp(_coderate_lp), |
76 | 76 | constellation(_constellation), trans_mode(_trans_mode), |
77 | | guard_interval(_guard_interval), hierarchy(_hierarchy) { ; } |
| 77 | guard_interval(_guard_interval), hierarchy(_hierarchy) { } |
78 | 78 | |
79 | | virtual ~FrequencyTable() { ; } |
| 79 | virtual ~FrequencyTable() { } |
80 | 80 | |
81 | 81 | // Common Stuff |
82 | 82 | QString name_format; ///< pretty name format |
-
diff --git a/libs/libmythtv/infostructs.h b/libs/libmythtv/infostructs.h
index 025ae44..9fa4dc2 100644
a
|
b
|
|
13 | 13 | class MPUBLIC ChannelInfo |
14 | 14 | { |
15 | 15 | public: |
16 | | ChannelInfo() {} |
17 | | ~ChannelInfo() {} |
| 16 | ChannelInfo() : chanid(-1), sourceid(-1), favid(-1), iconload(false) {} |
18 | 17 | |
19 | 18 | void LoadChannelIcon(int width, int height = 0); |
20 | 19 | QString Text(QString format); |
-
diff --git a/libs/libmythtv/mpeg/tspacket.h b/libs/libmythtv/mpeg/tspacket.h
index 7720d4d..b551181 100644
a
|
b
|
class TSPacket : public TSHeader |
127 | 127 | { |
128 | 128 | friend class PESPacket; |
129 | 129 | public: |
130 | | TSPacket() : TSHeader() {} |
| 130 | TSPacket() : TSHeader() { memset(_tspayload, 0, sizeof(char) * 184); } |
131 | 131 | static TSPacket* CreatePayloadOnlyPacket() |
132 | 132 | { |
133 | 133 | TSPacket *pkt = new TSPacket(); |
-
diff --git a/libs/libmythtv/osdtypeteletext.cpp b/libs/libmythtv/osdtypeteletext.cpp
index dcd453f..be2ee2d 100644
a
|
b
|
void OSDTypeTeletext::AddTeletextData(int magazine, int row, |
210 | 210 | { |
211 | 211 | OSDUpdateLocker locker(&m_lock, this); |
212 | 212 | |
213 | | int b1, b2, b3, err; |
| 213 | int b1, b2, b3, err = 0; |
214 | 214 | |
215 | 215 | if (magazine < 1 || magazine > 8) |
216 | 216 | return; |
-
diff --git a/libs/libmythtv/osdxvmc.cpp b/libs/libmythtv/osdxvmc.cpp
index ad77e97..5c094ed 100644
a
|
b
|
static inline xvmc_render_state_t *GetRender(VideoFrame *frame); |
23 | 23 | |
24 | 24 | XvMCOSD::XvMCOSD(Display *disp, int port, int surface_type_id, |
25 | 25 | int xvmc_surf_flags) |
26 | | : XJ_disp(disp), XJ_width(0), XJ_height(0), |
27 | | xv_port(port), osd_palette(NULL), osd_xv_image(NULL), |
28 | | osd_subpict_mode(NO_SUBPICTURE), osd_subpict_clear_color(0), |
29 | | osd_subpict_alloc(false) |
| 26 | : XJ_disp(disp), XJ_width(0) |
| 27 | , XJ_height(0), xv_port(port) |
| 28 | , osd_palette(NULL), osd_xv_image(NULL) |
| 29 | , osd_subpict_mode(NO_SUBPICTURE), osd_subpict_clear_color(0) |
| 30 | , osd_subpict_alloc(false), revision(-1) |
30 | 31 | { |
31 | 32 | bzero(&osd_subpict, sizeof(osd_subpict)); |
| 33 | bzero(&XJ_osd_shm_info, sizeof(XJ_osd_shm_info)); |
| 34 | bzero(&osd_subpict_info, sizeof(osd_subpict_info)); |
| 35 | bzero(&tmpframe, sizeof(tmpframe)); |
32 | 36 | // subpicture init |
33 | 37 | int num = 0; |
34 | 38 | XvImageFormatValues *xvfmv = NULL; |
-
diff --git a/libs/libmythtv/osdxvmc.h b/libs/libmythtv/osdxvmc.h
index 64f3f96..ce15136 100644
a
|
b
|
|
16 | 16 | class XvMCOSD |
17 | 17 | { |
18 | 18 | public: |
19 | | XvMCOSD() { ; } // dummy |
20 | | |
21 | 19 | XvMCOSD(Display *XJ_disp, int xv_port, |
22 | 20 | int surface_type_id, int xvmc_surf_flags); |
23 | 21 | |
-
diff --git a/libs/libmythtv/programdata.h b/libs/libmythtv/programdata.h
index b8db0ee..83377fb 100644
a
|
b
|
struct ProgCredit |
25 | 25 | class ProgInfo |
26 | 26 | { |
27 | 27 | public: |
28 | | ProgInfo() { } |
| 28 | ProgInfo() : |
| 29 | previouslyshown(false), audioproperties(-1), |
| 30 | videoproperties(-1), subtitletype(-1) { } |
29 | 31 | ProgInfo(const ProgInfo &other) { channel = other.channel; |
30 | 32 | startts = other.startts; |
31 | 33 | endts = other.endts; |
-
diff --git a/libs/libmythtv/signalmonitorvalue.h b/libs/libmythtv/signalmonitorvalue.h
index 0c0c423..90766ba 100644
a
|
b
|
class SignalMonitorValue |
12 | 12 | SignalMonitorValue(const QString& _name, const QString& _noSpaceName, |
13 | 13 | int _threshold, bool _high_threshold, |
14 | 14 | int _min, int _max, int _timeout); |
15 | | virtual ~SignalMonitorValue() { ; } |
16 | 15 | |
17 | 16 | // // // // // // // // // // // // // // // // // // // // // // // // |
18 | 17 | // Gets // // // // // // // // // // // // // // // // // // // // // |
… |
… |
class SignalMonitorValue |
121 | 120 | .arg( (IsGood()) ? "Is" : "Is NOT" ); |
122 | 121 | } |
123 | 122 | private: |
124 | | SignalMonitorValue() {} |
| 123 | SignalMonitorValue() |
| 124 | : value(-1), threshold(-1), minval(-1), maxval(-1), timeout(-1), |
| 125 | high_threshold(true), set(false) { } |
125 | 126 | SignalMonitorValue(const QString& _name, const QString& _noSpaceName, |
126 | 127 | int _value, int _threshold, bool _high_threshold, |
127 | 128 | int _min, int _max, int _timeout, bool _set); |
-
diff --git a/libs/libmythtv/ttfont.cpp b/libs/libmythtv/ttfont.cpp
index ae7f9ea..ed9590f 100644
a
|
b
|
using namespace std; |
31 | 31 | #include "osdtypes.h" |
32 | 32 | #include "osdsurface.h" |
33 | 33 | |
34 | | static int have_library = 0; |
35 | | static FT_Library the_library; |
| 34 | bool TTFFont::have_library = false; |
| 35 | FT_Library TTFFont::the_library; |
36 | 36 | |
37 | 37 | #define FT_VALID(handle) ((handle) && (handle)->clazz != NULL) |
38 | 38 | |
… |
… |
void TTFFont::KillFace(void) |
548 | 548 | |
549 | 549 | TTFFont::TTFFont(char *file, int size, float wscale, |
550 | 550 | float hmult) |
| 551 | : valid(false), face(0) |
| 552 | , max_descent(-1), max_ascent(-1) |
| 553 | , fontsize(size), vid_width(-1) |
| 554 | , vid_height(-1), use_kerning(false) |
| 555 | , spacewidth(0), m_size(size) |
| 556 | , m_outline(false), m_shadowxoff(0) |
| 557 | , m_shadowyoff(0), m_color_normal_y(255) |
| 558 | , m_color_normal_u(128), m_color_normal_v(128) |
| 559 | , m_color_outline_y(0x40), m_color_outline_u(128) |
| 560 | , m_color_outline_v(128), m_color_shadow_y(0x20) |
| 561 | , m_color_shadow_u(128), m_color_shadow_v(128) |
| 562 | , m_file(file), loadedfontsize(-1) |
| 563 | , m_wscale(wscale), m_hmult(hmult) |
| 564 | |
551 | 565 | { |
552 | | FT_Error error; |
553 | | |
554 | | valid = false; |
555 | | m_size = size; |
556 | | spacewidth = 0; |
557 | | |
558 | | m_outline = false; |
559 | | m_shadowxoff = 0; |
560 | | m_shadowyoff = 0; |
561 | | |
562 | | m_color_normal_y = 255; |
563 | | m_color_normal_u = m_color_normal_v = 128; |
564 | | |
565 | | m_color_outline_y = 0x40; |
566 | | m_color_outline_u = m_color_outline_v = 128; |
567 | | |
568 | | m_color_shadow_y = 0x20; |
569 | | m_color_shadow_u = m_color_shadow_v = 128; |
570 | | |
571 | 566 | if (!have_library) |
572 | 567 | { |
573 | | error = FT_Init_FreeType(&the_library); |
574 | | if (error) { |
| 568 | FT_Error error = FT_Init_FreeType(&the_library); |
| 569 | if (error) |
575 | 570 | return; |
576 | | } |
577 | | have_library++; |
578 | | } |
579 | 571 | |
580 | | fontsize = size; |
581 | | library = the_library; |
582 | | |
583 | | m_wscale = wscale; |
584 | | m_file = file; |
585 | | m_hmult = hmult; |
| 572 | have_library = true; |
| 573 | } |
586 | 574 | |
587 | 575 | Init(); |
588 | 576 | } |
… |
… |
void TTFFont::Init(void) |
622 | 610 | int xdpi = 96, ydpi = 96; |
623 | 611 | unsigned short i, n; |
624 | 612 | |
625 | | error = FT_New_Face(library, m_file, 0, &face); |
| 613 | error = FT_New_Face(the_library, m_file, 0, &face); |
626 | 614 | if (error) |
627 | 615 | { |
628 | 616 | return; |
-
diff --git a/libs/libmythtv/ttfont.h b/libs/libmythtv/ttfont.h
index 2ea0a5b..ebb8747 100644
a
|
b
|
class TTFFont |
69 | 69 | bool cache_glyph(unsigned short c); |
70 | 70 | |
71 | 71 | bool valid; |
72 | | FT_Library library; |
73 | 72 | FT_Face face; |
74 | 73 | QMap<unsigned short, FT_Glyph> glyphs; |
75 | 74 | QMap<unsigned short, Raster_Map *> glyphs_cached; |
… |
… |
class TTFFont |
104 | 103 | int loadedfontsize; |
105 | 104 | float m_wscale; |
106 | 105 | float m_hmult; |
| 106 | |
| 107 | static bool have_library; |
| 108 | static FT_Library the_library; |
107 | 109 | }; |
108 | 110 | |
109 | 111 | #endif |
-
diff --git a/libs/libmythtv/tv_play.h b/libs/libmythtv/tv_play.h
index 69b92d7..f42ebd0 100644
a
|
b
|
typedef enum |
102 | 102 | class AskProgramInfo |
103 | 103 | { |
104 | 104 | public: |
105 | | AskProgramInfo() : info(NULL) {} |
| 105 | AskProgramInfo() : |
| 106 | has_rec(false), has_later(false), |
| 107 | is_in_same_input_group(false), is_conflicting(false), |
| 108 | info(NULL) {} |
106 | 109 | AskProgramInfo(const QDateTime &e, bool r, bool l, ProgramInfo *i) : |
107 | 110 | expiry(e), has_rec(r), has_later(l), |
108 | 111 | is_in_same_input_group(false), is_conflicting(false), |
-
diff --git a/libs/libmythtv/vbitext/vbi.c b/libs/libmythtv/vbitext/vbi.c
index 2fc90f5..f7e31f4 100644
a
|
b
|
struct vbi * |
632 | 632 | vbi_open(const char *vbi_name, struct cache *ca, int fine_tune, int big_buf) |
633 | 633 | { |
634 | 634 | static int inited = 0; |
635 | | struct vbi *vbi; |
| 635 | struct vbi *vbi = 0; |
636 | 636 | |
637 | 637 | (void)ca; |
638 | 638 | |
-
diff --git a/libs/libmythtv/videooutbase.cpp b/libs/libmythtv/videooutbase.cpp
index 530f1a0..b2aa2d6 100644
a
|
b
|
VideoOutput::VideoOutput() : |
312 | 312 | framesPlayed(0), db_scaling_allowed(true), |
313 | 313 | supported_attributes(kPictureAttributeSupported_None) |
314 | 314 | { |
| 315 | bzero(&pip_tmp_image, sizeof(pip_tmp_image)); |
315 | 316 | db_display_dim = QSize(gContext->GetNumSetting("DisplaySizeWidth", 0), |
316 | 317 | gContext->GetNumSetting("DisplaySizeHeight", 0)); |
317 | 318 | |
-
diff --git a/libs/libmythtv/vsync.cpp b/libs/libmythtv/vsync.cpp
index 3de2d05..b8885ee 100644
a
|
b
|
VideoSync *VideoSync::BestMethod(VideoOutput *video_output, |
113 | 113 | VideoSync::VideoSync(VideoOutput *video_output, |
114 | 114 | int frameint, int refreshint, |
115 | 115 | bool halve_frame_interval) : |
116 | | m_video_output(video_output), |
117 | | m_frame_interval(frameint), m_refresh_interval(refreshint), |
118 | | m_interlaced(halve_frame_interval) |
| 116 | m_video_output(video_output), m_frame_interval(frameint), |
| 117 | m_refresh_interval(refreshint), m_interlaced(halve_frame_interval), |
| 118 | m_delay(-1) |
119 | 119 | { |
| 120 | bzero(&m_nexttrigger, sizeof(m_nexttrigger)); |
120 | 121 | if (m_interlaced && m_refresh_interval > m_frame_interval/2) |
121 | 122 | m_interlaced = false; // can't display both fields at 2x rate |
122 | 123 | |
… |
… |
const char *nVidiaVideoSync::sm_nvidia_dev = "/dev/nvidia0"; |
359 | 360 | |
360 | 361 | nVidiaVideoSync::nVidiaVideoSync(VideoOutput *vo, |
361 | 362 | int fi, int ri, bool intr) : |
362 | | VideoSync(vo, fi, ri, intr) |
| 363 | VideoSync(vo, fi, ri, intr), m_nvidia_fd(-1) |
363 | 364 | { |
364 | 365 | } |
365 | 366 | |