Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#9997 closed Bug Report - General (Fixed)

patch: Fix commercial flagging to return consistent results

Reported by: kevin@… Owned by: markk
Priority: minor Milestone:
Component: MythTV - Mythcommflag Version: 0.24.1
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Running mythcommflag on a recording, and comparing the results of --getskiplist after rerunning the command several times would result in inconsistent results. One would expect to get the same results every time. Also, the results of commercial flagging were usually rather poor (for me). This seemed to be a regression in 0.24.

I believe the problem was with the implementation of MythPlayer::GetRawVideoFrame?. At the end of the function, it would return the result of GetLastDecodedFrame?. I believe this to be incorrect. When printing the frame numbers of the frames returned, sometimes I would get the same frame number returned multiple times, and other times it would skip a frame or two (or more). Basically, it's returning the frame from the tail of the queue, when it should be returning the frame from the head of the queue.

My fix is to call StartDisplayingFrame?, followed by GetLastShownFrame?. This returns the frame from the head of the queue, and printing the frame numbers always results in a nice even output of frame numbers, no duplicates, no skips.

Now my commercial flagging is much improved, and rerunning mythcommflag multiple times on a recording results in the same results each time.

-- Kevin

Attachments (1)

mythplayer.patch (572 bytes) - added by kevin@… 13 years ago.

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by kevin@…

Attachment: mythplayer.patch added

comment:1 Changed 12 years ago by tralph

Owner: changed from cpinkham to markk
Status: newassigned

Mark, The description of the problem by Kevin is spot on. The patch also seems to make sense and I've been running it for a couple weeks without issue. I was hoping you could take a look also since it was last touched by the MythUI-OSD merge, commit 59f10b3982aec9ab228169c3935e94509ee5f9d4.

comment:2 Changed 12 years ago by sphery

Milestone: unknown0.24.2
Resolution: Fixed
Status: assignedclosed

Fixed by f135d5d5e and backported to 0.24-fixes in cb01f3079a0:

Fix MythPlayer::GetRawVideoFrame?() for mythcommflag.

Fix MythPlayer::GetRawVideoFrame?() to return the correct frame number. This change fixes mythcommflag so that it will return consistent results across multiple runs. It should also improve commercial detection accuracy, as the frame numbers identified by the different methods will actually be precise--allowing for better comparing the results of the different methods.

Although this commit has my name for the signed-off line, I didn't do much. Thanks to Kevin Ross for the debugging and the patch, to Taylor Ralph and Mark Kendall for actually reviewing the patch, and to all the users and devs who ran with the patch to test it (and saw greatly-improved commercial flagging results).

Fixes #9997.

Signed-off-by: Michael T. Dean <mdean@…>

comment:3 Changed 12 years ago by stuartm

Milestone: 0.24.2

Milestone 0.24.2 deleted

Note: See TracTickets for help on using tickets.