Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8589 closed defect (fixed)

Recordings are nolonger identified as 720p or 1080i/p since the ProgramInfo refactor.

Reported by: MarcT <myrdhn@…> Owned by: robertm
Priority: trivial Milestone: 0.24
Component: MythTV - Recording Version: Master Head
Severity: low Keywords:
Cc: Ticket locked: no

Description

Changes in mythtv/libs/libmyth/programinfo.cpp during the ProgramInfo? refactor r24694 removed funtionality to identify a recording as 1080i/p or 720p.

Change History (13)

comment:1 Changed 9 years ago by MarcT <myrdhn@…>

There is a specific section of code that was removed that in the programinfo refactor that never had a similar function added to replace the functionality of the removed code.

This is the section that was removed

query.prepare("UPDATE recordedprogram SET videoprop =" " CONCAT_WS(',', IF(videoprop = , NULL, videoprop), :VALUE)" " WHERE chanid = :CHANID AND starttime = :STARTTIME;");

if (width > 1300) {

VERBOSE(VB_GENERAL, LOC +

QString("Recording designated 1080i/p because width was %1") .arg(width));

videoproperties |= VID_1080;

query.bindValue(":VALUE", "1080"); query.bindValue(":CHANID", chanid); query.bindValue(":STARTTIME", startts);

if (!query.exec())

MythDB::DBError("UpdateRes?", query);

} else if (width > 800) {

VERBOSE(VB_GENERAL, LOC +

QString("Recording designated 720p because width was %1") .arg(width));

videoproperties |= VID_720;

query.bindValue(":VALUE", "720"); query.bindValue(":CHANID", chanid); query.bindValue(":STARTTIME", startts);

if (!query.exec())

MythDB::DBError("UpdateRes?", query);

} else {

VERBOSE(VB_IMPORTANT, LOC_ERR +

QString("Unknown type, recording width was %1").arg(width));

return;

}

m_videoWidth = width;

This is the section that was added.

query.prepare(

"UPDATE recordedprogram " "SET videoprop = ((videoprop+0) & :OTHERFLAGS) | :FLAGS " "WHERE chanid = :CHANID AND starttime = :STARTTIME");

query.bindValue(":OTHERFLAGS", ~(VID_1080|VID_720)); query.bindValue(":FLAGS", vid_flags); query.bindValue(":CHANID", chanid); query.bindValue(":STARTTIME", recstartts);

uint videoproperties = GetVideoProperties?(); videoproperties &= (uint16_t) ~(VID_1080|VID_720); videoproperties |= (uint16_t) vid_flags; properties &= ~(0x1F<<6); properties |= videoproperties<<6;

Looking at these it seems that the code to set the value as 720 or 1080 was removed and no replacement was added.

Here is a select statement from my database from the recordedprogram table

select chanid,starttime,title,videoprop from recordedprogram where title like 'CSI%' order by starttime;

+--------+---------------------+------------+-----------+ | chanid | starttime | title | videoprop | +--------+---------------------+------------+-----------+ | 2804 | 2010-05-03 22:01:00 | CSI: Miami | HDTV,1080 | | 2804 | 2010-05-05 22:00:00 | CSI: NY | HDTV,720 | | 2804 | 2010-05-10 22:01:00 | CSI: Miami | HDTV,1080 | | 2804 | 2010-05-12 22:00:00 | CSI: NY | HDTV,1080 | | 2814 | 2010-05-16 18:00:00 | CSI: Miami | HDTV,1080 | | 2814 | 2010-05-16 23:00:00 | CSI: Miami | HDTV | | 2804 | 2010-05-17 22:01:00 | CSI: Miami | HDTV | | 2804 | 2010-05-19 22:00:00 | CSI: NY | HDTV | | 2814 | 2010-05-23 18:00:00 | CSI: Miami | HDTV | +--------+---------------------+------------+-----------+

As you can see the 720/1080 is nolonger being sent to the videoprop column in the table since the update I did in between the 2 recordings from May 16th.

comment:2 Changed 9 years ago by MarcT <myrdhn@…>

Sorry the SQL output came out horrible.

+--------+---------------------+------------+-----------+
| chanid | starttime           | title      | videoprop |
+--------+---------------------+------------+-----------+
|   2804 | 2010-05-03 22:01:00 | CSI: Miami | HDTV,1080 |
|   2804 | 2010-05-05 22:00:00 | CSI: NY    | HDTV,720  |
|   2804 | 2010-05-10 22:01:00 | CSI: Miami | HDTV,1080 |
|   2804 | 2010-05-12 22:00:00 | CSI: NY    | HDTV,1080 |
|   2814 | 2010-05-16 18:00:00 | CSI: Miami | HDTV,1080 |
|   2814 | 2010-05-16 23:00:00 | CSI: Miami | HDTV      |
|   2804 | 2010-05-17 22:01:00 | CSI: Miami | HDTV      |
|   2804 | 2010-05-19 22:00:00 | CSI: NY    | HDTV      |
|   2814 | 2010-05-23 18:00:00 | CSI: Miami | HDTV      |
+--------+---------------------+------------+-----------+

comment:3 Changed 9 years ago by robertm

Status: newassigned

comment:4 Changed 9 years ago by robertm

Milestone: unknown0.24

comment:5 Changed 9 years ago by danielk

It looks like this is supposed to be handled by the SaveResolutionProperty?() call in TVRec::TeardownRecorder?(). Not sure yet why it is not working.

comment:6 Changed 9 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [26277]) Fixes #8589. Save video flags... It's nice to build a SQL query and all but we need to execute it too.

comment:7 Changed 9 years ago by David Madsen <david.madsen@…>

In the process of testing this patch I have discovered a small problem with the fix. The SQL query that is updating the flags in the recordedprogram table is matching on STARTTIME == recstartts.

In cases where the recording has a preroll or start early rule the recstartts time will not match the STARTTIME field in the recordedprogram table and the update will not occur.

Changing the binding for :STARTTIME to be startts instead of recstartts fixed the issue for me.

comment:8 Changed 9 years ago by David Madsen <david.madsen@…>

Resolution: fixed
Status: closednew

comment:9 Changed 9 years ago by Kenni Lund [kenni a kelu dot dk]

Status: newassigned

comment:10 Changed 9 years ago by robertm

Owner: changed from danielk to robertm

comment:11 Changed 9 years ago by robertm

Resolution: fixed
Status: assignedclosed

(In [26358]) Restore the original behavior of the markup query SQL to use startts as the key, not recstartts-- since the pginfo refactor and subsequent restoration of this functionality, setting the video flags was failing if the recording had preroll. This should restore reliable behavior to all recordings. Fixes #8589.

comment:12 Changed 9 years ago by robertm

(In [26362]) Fix a boneheaded move on my part. Refs #8589.

comment:13 Changed 9 years ago by danielk

(In [26557]) Refs #8589. Remove some debugging accidentally left in [26277].

Note: See TracTickets for help on using tickets.