Opened 7 years ago

Closed 5 years ago

#13057 closed Patch - Bug Fix (fixed)

Program title and/or description sometimes wrong

Reported by: klaas@… Owned by: Klaas de Waal
Priority: minor Milestone: 31.0
Component: MythTV - EIT Version: Master Head
Severity: low Keywords: EIT DVB-C UpdateDB
Cc: Ticket locked: no

Description

MythTV guide data, as received from DVB-C, has incidentally a wrong program title and/or a wrong program description. Attached is a picture of my TV recordings, showing the program title "Live motorsport" (which is OK) with a description of a football match in South Korea (which is NOT OK). Attached is also a picture from the guide of the TV itself which shows the correct program description. This is caused by a few lines in libs/libmythtv/programdata.cpp that only accepts updates for title, subtitle and description fields of EPG data when the new EPG data for these field is LONGER than the previously received data for that field. This means that, for example, the broadcaster does change its programming and does change "Live Motorsport" to "Football" the title of the program will never change to "Football" in MythTV because the title is shorter. As a result, recording rules based on string pattern matching of title and/or description can fail to record the correct program. This bug has been in MythTV since about the year zero.

Details: This happens in UpdateDB, starting at line 616. This function is called when existing program data is to be replaced by new data. In this function the old program data is updated on a field by field basis. Attached is a fixed version in which the new data completely replaces the old data.

This has been tested with my DVB-C signal (Ziggo in The Netherlands) but it has not been tested with DVB-T or DVB-S.

Attachments (6)

20170604_090515_2.jpg (380.8 KB) - added by klaas@… 7 years ago.
wrong program description on mythtv
20170604_090636_2.jpg (205.9 KB) - added by klaas@… 7 years ago.
correct program description on TV guide
programdata.cpp.master.kdw (51.6 KB) - added by klaas@… 7 years ago.
libs/libmythtv/programdata.cpp with fix
programdata.cpp.fixed_with_debug (59.4 KB) - added by klaas@… 7 years ago.
libs/libmythtv/programdata.cpp with fix and with lots of debug code
programdata.cpp.diff (2.8 KB) - added by klaas@… 7 years ago.
git diff of final version, identical to pull request
20190131-programdata-update.patch (1.0 KB) - added by Klaas de Waal 5 years ago.
Fix for update of title/subtitle/description and airdate.

Download all attachments as: .zip

Change History (11)

Changed 7 years ago by klaas@…

Attachment: 20170604_090515_2.jpg added

wrong program description on mythtv

Changed 7 years ago by klaas@…

Attachment: 20170604_090636_2.jpg added

correct program description on TV guide

Changed 7 years ago by klaas@…

Attachment: programdata.cpp.master.kdw added

libs/libmythtv/programdata.cpp with fix

Changed 7 years ago by klaas@…

libs/libmythtv/programdata.cpp with fix and with lots of debug code

comment:1 Changed 7 years ago by Stuart Auchterlonie

Klaas,

Can you do a git diff to capture the changes to programdata.cpp please?

Regards Stuart

comment:2 Changed 7 years ago by klaas@…

Created pull request for my commit 0c66e7f298eac4ebf60d047e3efb4fb7c5844b32

Changed 7 years ago by klaas@…

Attachment: programdata.cpp.diff added

git diff of final version, identical to pull request

comment:3 Changed 5 years ago by Klaas de Waal

Updated the patch for today's master.
The changes are now limited to title/subtitle/description and airdate.

The existing code for title/subtitle/description compares the string as stored in the database with the newly received string and uses the longest. This is wrong as already documented in the original bug report.
This patch copies the old value of title/subtitle/description only if there is no new value but there is an old value.
Example: the modification for the title:

-    if (match.title.length() >= ltitle.length())
+    if (ltitle.isEmpty() && !match.title.isEmpty())
         ltitle = match.title;

N.B. The code for title/subtitle/description update is copied from branch fixes/0.27 of the mythtv fork of dcjm/David Matthews. He apparently found this bug also but he has not submitted a ticket for this AFAIK.

The attached patch does also have a correction for the update of the airdate:

-    if (!lairdate && !match.airdate)
+    if (!lairdate && match.airdate)
         lairdate = match.airdate;

The old code uses the old airdate only if the newly received airdate and the old airdate are both zero. This is obviously a mistake. The new code uses the old airdate only if the new airdate is zero and the old airdate is not.

Changed 5 years ago by Klaas de Waal

Fix for update of title/subtitle/description and airdate.

comment:4 Changed 5 years ago by Klaas de Waal

Milestone: unknown31.0
Owner: changed from Karl Egly to Klaas de Waal
Status: newaccepted

comment:5 Changed 5 years ago by Klaas de Waal <kdewaal@…>

Resolution: fixed
Status: acceptedclosed

In 62ae08961/mythtv:

Update guide title/subtitle/description with new DVB EIT data

The title/subtitle/description in the guide is now updated
with the latest information received from DVB EIT. The title
is now updated with the newly received data unless the new
title is an empty string.
Previously, the title was only updated if the new title was
longer than the old title. This caused missed recordings when
recording rules are used that refer to the program title.
The same for the subtitle and the description.

Fixes #13057

Note: See TracTickets for help on using tickets.