Skip to content

Commit

Permalink
Alter mythcommflag --video behavior
Browse files Browse the repository at this point in the history
In --video mode, mythcommflag currently requires a myth:// URI, absolute
file path or path relative from the current directory.  This adds a
fallthrough behavior where if a local path cannot be found, it attempts
to access it as a myth:// URI at the local hostname.  This is half of
the fix for #9435, the second half will require ProgramInfo to properly
store seekdata for such files.

Refs #9435
  • Loading branch information
wagnerrp committed Jul 23, 2011
1 parent 037ba2a commit 546af2f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions mythtv/programs/mythcommflag/main.cpp
Expand Up @@ -998,15 +998,25 @@ static int FlagCommercials(QString filename, int jobid,


static int RebuildSeekTable(ProgramInfo *pginfo, int jobid) static int RebuildSeekTable(ProgramInfo *pginfo, int jobid)
{ {
QString filename = get_filename(pginfo);

if (!DoesFileExist(pginfo)) if (!DoesFileExist(pginfo))
{ {
LOG(VB_GENERAL, LOG_ERR, // file not found on local filesystem
"Unable to find file in defined storage paths."); // assume file is in Video storage group on local backend
return GENERIC_EXIT_PERMISSIONS_ERROR; // and try again

filename = QString("myth://Video@%1/%2")
.arg(gCoreContext->GetHostName()).arg(filename);
pginfo->SetPathname(filename);
if (!DoesFileExist(pginfo))
{
LOG(VB_GENERAL, LOG_ERR,
"Unable to find file in defined storage paths.");
return GENERIC_EXIT_PERMISSIONS_ERROR;
}
} }


QString filename = get_filename(pginfo);

RingBuffer *tmprbuf = RingBuffer::Create(filename, false); RingBuffer *tmprbuf = RingBuffer::Create(filename, false);
if (!tmprbuf) if (!tmprbuf)
{ {
Expand Down

0 comments on commit 546af2f

Please sign in to comment.