Permalink
Browse files

Use the latest frame count when transcoding in-progress recordings.

Fixes #11339.  Report reasonable percent completion status for HLS
transcodes of in-progress recordings.
  • Loading branch information...
stichnot committed Jan 24, 2013
1 parent 9d9de7b commit ae8406425160e7e33a758904fe1b300a04dd8e64
Showing with 15 additions and 1 deletion.
  1. +8 −1 mythtv/programs/mythtranscode/main.cpp
  2. +7 −0 mythtv/programs/mythtranscode/transcode.cpp
@@ -28,6 +28,7 @@ using namespace std;
#include "commandlineparser.h"
#include "recordinginfo.h"
#include "signalhandling.h"
#include "HLS/httplivestream.h"
static void CompleteJob(int jobID, ProgramInfo *pginfo, bool useCutlist,
frm_dir_map_t *deleteMap, int &resultCode);
@@ -480,7 +481,13 @@ int main(int argc, char *argv[])
ProgramInfo *pginfo = NULL;
if (cmdline.toBool("hls"))
{
pginfo = new ProgramInfo();
if (cmdline.toBool("hlsstreamid"))
{
HTTPLiveStream hls(cmdline.toInt("hlsstreamid"));
pginfo = new ProgramInfo(hls.GetSourceFile());
}
if (pginfo == NULL)
pginfo = new ProgramInfo();
}
else if (isVideo)
{
@@ -21,6 +21,7 @@
#include "exitcodes.h"
#include "mthreadpool.h"
#include "deletemap.h"
#include "tvremoteutil.h"
#include "NuppelVideoRecorder.h"
#include "mythplayer.h"
@@ -255,6 +256,11 @@ int Transcode::TranscodeFile(const QString &inputname,
player_ctx->SetPlayer(new MythPlayer(kVideoIsNull));
SetPlayerContext(player_ctx);
GetPlayer()->SetPlayerInfo(NULL, NULL, GetPlayerContext());
if (m_proginfo->GetRecordingEndTime() > curtime)
{
player_ctx->SetRecorder(RemoteGetExistingRecorder(m_proginfo));
GetPlayer()->SetWatchingRecording(true);
}
if (showprogress)
{
@@ -1433,6 +1439,7 @@ int Transcode::TranscodeFile(const QString &inputname,
if (elapsed)
flagFPS = curFrameNum / elapsed;
total_frame_count = GetPlayer()->GetCurrentFrameCount();
int percentage = curFrameNum * 100 / total_frame_count;
if (hls)

0 comments on commit ae84064

Please sign in to comment.