2012-04-03, 19:38
We quite often use "chase play" (start a recording, wait a while, begin watching while still recording) in our house. This basically works well, with the exception that the recording length is not updated while watching, it is firmly set to whatever the length was when you started watching. Not a big a deal unless you want to skip forward, at which point it becomes very annoying. Anyway, I took a look at the code, and it seems that the backend periodically informs the frontend of updated recording sizes via the CMYTH_EVENT_UPDATE_FILE_SIZE. So, I added some code in MythEventHandler::ImpMythEventHandler::Action() to store this information, and adapted PVRClientMythTV::LengthRecordedStream() to check if the EventHandler has any uptodate info. This works well, except for the little detail that LengthRecordedStream really should return the length of the stream (as seconds I presume) and not the size in bytes as provided by the backend event.
Now to my questions:
1. Am I going about this the right way?
2. Have I understood the expected units correctly?
3. If yes and yes, then how do I convert the file size to duration? I guess dividing the size with the average bitrate would do the trick, but how would I find the average bitrate?
4. Is there a simpler way to do this?
/D
Now to my questions:
1. Am I going about this the right way?
2. Have I understood the expected units correctly?
3. If yes and yes, then how do I convert the file size to duration? I guess dividing the size with the average bitrate would do the trick, but how would I find the average bitrate?
4. Is there a simpler way to do this?
/D