2013-11-21, 16:59
the xbmc calculated times are rounded down in this code:
This is in the WriteMPlayerEdl function in xbmc/cores/dvdplayer/Edl.cpp
The calculation is down between 2 integers and then casted to a float. That is why all the times end in 000.
For commercial skips that start seconds too early are mainly caused in longer shows, or shows with more variability to their frame rate. And also the initial reported frame rate.
The EDL code in xbmc assumes a constant framerate. So for longer shows the error is increased later in the show.
By using the milliseconds that mythtv now provides for the marks the xbmc code should not have to calculate the time of the mark, it can just write it to the EDL file.
But whatever method is used, the WriteMplayerEdl function will always truncate the time to .000 unless that function uses floats to calculate instead of ints.
Change:
to
And you should get the desired results.
Code:
strBuffer += StringUtils::Format("%.3f\t%.3f\t%i\n", (float)(m_vecCuts[i].start / 1000),
(float)(m_vecCuts[i].end / 1000),
m_vecCuts[i].action == MUTE ? 1 : 0);
This is in the WriteMPlayerEdl function in xbmc/cores/dvdplayer/Edl.cpp
The calculation is down between 2 integers and then casted to a float. That is why all the times end in 000.
For commercial skips that start seconds too early are mainly caused in longer shows, or shows with more variability to their frame rate. And also the initial reported frame rate.
The EDL code in xbmc assumes a constant framerate. So for longer shows the error is increased later in the show.
By using the milliseconds that mythtv now provides for the marks the xbmc code should not have to calculate the time of the mark, it can just write it to the EDL file.
But whatever method is used, the WriteMplayerEdl function will always truncate the time to .000 unless that function uses floats to calculate instead of ints.
Change:
Code:
(float)(m_vecCuts[i].start / 1000)
Code:
(float)m_vecCuts[i].start / 1000
And you should get the desired results.