Opened 10 years ago
Closed 10 years ago
#12056 closed Patch - Bug Fix (Fixed)
Two cc608 mid-row codes in a row cause QPainter warning
Reported by: | Owned by: | Jim Stichnoth | |
---|---|---|---|
Priority: | minor | Milestone: | 0.27.4 |
Component: | MythTV - Captions | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
After porting the latest changes in master for closed captions to 0.27, and playing this video clip with VBI CCs enabled: http://ncamftp.wgbh.org/DTV/CEA%20test%20material/Iteration_1/CEAv1.2zero.trp the following messages are written several times to stderr by the Qt library:
QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setFont: Painter not active QPainter::setPen: Painter not active QPainter::setBrush: Painter not active QPainter::end: Painter not active, aborted
I'm pretty sure the same problem exists in master, I just don't have a master runtime environment to confirm it. I have confirmed the problem does not exist in 0.27-fixes.
Turns out the above complaints from Qt occur whenever two mid-row codes in a row are processed. They lead to:
- a zero width textRect in FormattedTextChunk::PreRender?(),
- which leads to creation of a QImage with no allocated data,
- which leads to the complaints from QPainter.
You can also get Qt to abort and dump core at the point QPainter detects the problem, if you run mythfrontend with the environment variable, QT_FATAL_WARNINGS=1, and then play the above video clip. See http://qt-project.org/doc/qt-4.8/debug.html
Attached is a patch that tests for and fixes the zero width textRect. It fixes the problem in my 0.27-with-cc-changes-from-master environment and should fix it in master, too.
Attachments (1)
Change History (6)
Changed 10 years ago by
Attachment: | mid-row-zero-rect.patch added |
---|
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Milestone: | unknown → 0.27.4 |
---|---|
Status: | new → accepted |
comment:5 Changed 10 years ago by
Resolution: | → Fixed |
---|---|
Status: | accepted → closed |
Forgot to mention that you can seek forward 3 minutes into the Iteration1 clip. The problematic mid-row codes are part of the demo described in slide 68, which starts soon after the clock displays 01:03:23:00.