Ticket #5118: libs_libmythtv_channel.cpp-check-GetV4LInfo.patch

File libs_libmythtv_channel.cpp-check-GetV4LInfo.patch, 1022 bytes (added by Erik Hovland <erik@…>, 12 years ago)

check CardUtil::GetV4LInfo() for failure

  • libs/libmythtv/channel.cpp

    GetV4LInfo can fail. We should check it.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     libs/libmythtv/channel.cpp |   11 ++++++++++-
     1 files changed, 10 insertions(+), 1 deletions(-)
    
    diff --git a/libs/libmythtv/channel.cpp b/libs/libmythtv/channel.cpp
    index 3bae71d..72da60b 100644
    a b bool Channel::Open(void) 
    8686    }
    8787
    8888    usingv4l2 = CardUtil::hasV4L2(videofd);
    89     CardUtil::GetV4LInfo(videofd, device_name, driver_name);
     89    if (!CardUtil::GetV4LInfo(videofd, device_name, driver_name))
     90    {
     91        VERBOSE(VB_IMPORTANT,
     92                QString("Channel(%1)::Open(): Can't get V4l info on video "
     93                        " device %2 driver %3 videofd %4")
     94                        .arg(device).arg(device_name).arg(driver_name)
     95                        .arg(videofd));
     96        return false;
     97    }
     98
    9099    VERBOSE(VB_CHANNEL, LOC + QString("Device name '%1' driver '%2'.")
    91100            .arg(device_name).arg(driver_name));
    92101