[mythtv-users] load_file_info() return success or fail

Brian J. Murrell brian at interlinx.bc.ca
Fri Oct 22 18:34:12 UTC 2010


Currently (on 0.23-fixes), it is assumed that load_file_info() in
Recording.pm will always succeed.  That is because it's workers
_mpeg_info() and _nuv_info() will simply die() if they find something
they don't like (which is not very nice).  And only sometimes.  There is
at least one occurrence in _nuv_info() where it returns undef instead:

    # Is this even a NUV file?
        if ($info{'finfo'} !~ /MythTVVideo/) {
            close DATA;
            return undef;
        }

This inconsistency aside, it seems like better handling would be to
always return undef back up through the call stack on failures and have
the caller(s) deal with it.  The attached patch opens the door for that
to happen.  I have not removed all of the die()s in _nuv_info() and
_mpeg_info() but have removed one to demonstrate the concept as well as
trickling the failure up through to load_file_info()'s caller.

Thots?

b.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/x-patch
Size: 1325 bytes
Desc: not available
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20101022/51bf3a22/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20101022/51bf3a22/attachment.pgp>


More information about the mythtv-users mailing list