[mythtv-commits] Ticket #10793: CommFlagger improvements

MythTV noreply at mythtv.org
Fri Oct 19 10:03:22 UTC 2012


#10793: CommFlagger improvements
-----------------------------------+-----------------------------
 Reporter:  markspieth             |          Owner:  cpinkham
     Type:  Patch - Feature        |         Status:  new
 Priority:  minor                  |      Milestone:  unknown
Component:  MythTV - Mythcommflag  |        Version:  Unspecified
 Severity:  medium                 |     Resolution:
 Keywords:                         |  Ticket locked:  0
-----------------------------------+-----------------------------

Comment (by Wayne McDougall <waynemcdougall@…>):

 In SubtitleChangeDetector.cpp there is the following code:
 {{{
             //subtitle.start_display_time;    /* relative to packet pts,
 in ms */
             //subtitle.end_display_time;  /* relative to packet pts, in ms
 */
             //subtitle.pts;               /* in AV_TIME_BASE, use frame
 number * fps */

             int start = frameNumber + subtitle.start_display_time * fps /
 1000;
             int end   = frameNumber + subtitle.end_display_time * fps /
 1000;
 }}}
 It seems to me this code assumes start_display_time and end_display_time
 are relative times to the frame number. Instead in my recordings they are
 absolutes timecodes in ms, directly related to the timecodes associated
 with each video frame. And the above code yields incorrect framenumbers,
 and subtitle detection fails.

 I guess we could subtract the the initial frame's timecode, if we can
 assume fps is constant for recordings. I'm not sure that is a safe
 assumption. I suspect the time code wraps around to zero at some point,
 and that would need to be handled.

 Instead I think it would be safer to follow the pattern of
 subtitlescreen.cpp which just compares the subtitle start and end
 timecodes with the frame timecodes.

 Presumably the current code works for some people, although I find it hard
 to see how. It's entirely possible I'm not understanding something deeper
 here. Comments welcome. But I'm hoping if I do a good job, the changed
 code should still work correctly for them and also work for me.

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/10793#comment:6>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list