Ticket #2722: libavc1394-0.5.3-int-changer.diff

File libavc1394-0.5.3-int-changer.diff, 3.1 KB (added by jwestfall, 19 years ago)
  • libs/libmythtv/firewirechannel.cpp

     
    1616#define LOC QString("FireChan: ")
    1717#define LOC_ERR QString("FireChan, Error: ")
    1818
    19 #ifndef AVC1394_PANEL_COMMAND_PASS_THROUGH
    20 #define AVC1394_PANEL_COMMAND_PASS_THROUGH     0x000007C00
    21 #endif
    22 
    23 #ifndef AVC1394_PANEL_OPERATION_0
    24 #define AVC1394_PANEL_OPERATION_0              0x000000020
    25 #endif
    26 
    2719#define DCT6200_CMD0  (AVC1394_CTYPE_CONTROL | \
    2820                       AVC1394_SUBUNIT_TYPE_PANEL | \
    2921                       AVC1394_SUBUNIT_ID_0 | \
     
    10496            quadlet_t cmd[2] =  { DCT6200_CMD0 | dig[i], 0x0, };
    10597            if (!avc1394_transaction_block(fwhandle, fw_opts.node, cmd, 2, 1))
    10698            {
     99                 avc1394_transaction_block_close(fwhandle);
    107100                 VERBOSE(VB_IMPORTANT, "AVC transaction failed.");
    108101                 return false;
    109102            }
     103            avc1394_transaction_block_close(fwhandle);
    110104            usleep(500000);
    111105        }
    112106    }
     
    132126
    133127        if(!avc1394_transaction_block(fwhandle, fw_opts.node, cmd, 3, 1))
    134128        {
     129            avc1394_transaction_block_close(fwhandle);
    135130            VERBOSE(VB_IMPORTANT, "AVC transaction failed.");
    136131            return false;
    137132        }
     133        avc1394_transaction_block_close(fwhandle);
    138134
    139135        cmd[0] = SA3250_CMD0 | AVC1394_SA3250_OPERAND_KEY_RELEASE;
    140136        cmd[1] = SA3250_CMD1 | (dig[0] << 16) | (dig[1] << 8) | dig[2];
     
    149145
    150146        if (!avc1394_transaction_block(fwhandle, fw_opts.node, cmd, 3, 1))
    151147        {
     148            avc1394_transaction_block_close(fwhandle);
    152149            VERBOSE(VB_IMPORTANT, "AVC transaction failed.");
    153150            return false;
    154151        }
     152        avc1394_transaction_block_close(fwhandle);
    155153    }
    156154    else if (fw_opts.model == "SA4200HD")
    157155    {
     
    170168
    171169        if (!avc1394_transaction_block(fwhandle, fw_opts.node, cmd, 3, 1))
    172170        {
     171            avc1394_transaction_block_close(fwhandle);
    173172            VERBOSE(VB_IMPORTANT, "AVC transaction failed.");
    174173            return false;
    175174        }
     175        avc1394_transaction_block_close(fwhandle);
    176176    }
    177 
    178177    return true;
    179178}
    180179
     
    229228        if (rval)
    230229        {
    231230            response = rval[0];
     231            avc1394_transaction_block_close(fwhandle);
    232232
    233233            if (AVC1394_MASK_RESPONSE(response) == AVC1394_RESPONSE_ACCEPTED)
    234234            {
     
    254254        }
    255255        else
    256256        {
     257            avc1394_transaction_block_close(fwhandle);
    257258            VERBOSE(VB_IMPORTANT, LOC + "Power on cmd failed (no response)");
    258259            return false;
    259260        }
     
    278279    if (rval)
    279280    {
    280281        response = rval[0];
     282        avc1394_transaction_block_close(fwhandle);
    281283
    282284        if (AVC1394_MASK_RESPONSE(response) == AVC1394_RESPONSE_IMPLEMENTED)
    283285        {
     
    309311            return Failed;
    310312        }
    311313    }
     314    avc1394_transaction_block_close(fwhandle);
    312315    VERBOSE(VB_CHANNEL, LOC + "Failed to get STB Power State");
    313316    return Failed;
    314317}