Ticket #10029: 0021-Fix-mythhdd-to-mount-nerwly-inserted-USB-keydiscs.patch

File 0021-Fix-mythhdd-to-mount-nerwly-inserted-USB-keydiscs.patch, 1.8 KB (added by Lawrence Rust <lvr@…>, 9 years ago)
  • mythtv/libs/libmythbase/mythhdd.cpp

    From dd7200697f9a7ce7e33485ee6f055431dc5a2b2e Mon Sep 17 00:00:00 2001
    From: Lawrence Rust <lvr@softsystem.co.uk>
    Date: Fri, 15 Apr 2011 09:30:55 +0200
    Subject: [PATCH 1/2] Fix mythhdd to mount nerwly inserted ?USB keydiscs
    
    Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
    ---
     mythtv/libs/libmythbase/mythhdd.cpp |    8 ++++++--
     1 files changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/mythtv/libs/libmythbase/mythhdd.cpp b/mythtv/libs/libmythbase/mythhdd.cpp
    index ebf75a6..a645ee8 100644
    a b  
    11#include "mythhdd.h"
     2#include "mythlogging.h"
    23
    34/** \fn MythHDD::Get(QObject*, const char*, bool, bool)
    45 *  \brief Helper function used to create a new instance
    MythHDD::MythHDD(QObject *par, const char *DevicePath, 
    2223                 bool SuperMount, bool AllowEject)
    2324    : MythMediaDevice(par, DevicePath, SuperMount, AllowEject)
    2425{
     26    LOG(VB_MEDIA, LOG_INFO, "MythHDD::MythHDD " + m_DevicePath);
    2527    m_Status = MEDIASTAT_UNPLUGGED;
    2628    m_MediaType = MEDIATYPE_DATA;       // default type is data
    2729}
    MythMediaStatus MythHDD::checkMedia(void) 
    3840        m_VolumeID = m_MountPath;
    3941
    4042        // device is mounted, trigger event
     43        if (MEDIASTAT_MOUNTED != m_Status)
     44            m_Status = MEDIASTAT_NOTMOUNTED;
    4145        return setStatus(MEDIASTAT_MOUNTED);
    4246    }
    4347
    MythMediaStatus MythHDD::checkMedia(void) 
    4549    if (m_Status == MEDIASTAT_UNPLUGGED)
    4650    {
    4751        // a removable device was just plugged in try to mount it.
    48         mount();
    49         if (isMounted())
     52        LOG(VB_MEDIA, LOG_INFO, "MythHDD::checkMedia try mounting " + m_DevicePath);
     53        if (mount())
    5054        {
    5155            m_Status = MEDIASTAT_NOTMOUNTED;
    5256            return setStatus(MEDIASTAT_MOUNTED);