Changeset 5281ab9


Ignore:
Timestamp:
01/29/15 13:18:56 (5 weeks ago)
Author:
Ken Moore <ken@…>
Branches:
master
Children:
49469aa
Parents:
d08c14d
Message:

Use cdparanoia for audio cd probing. This is much better about not interfering with the disk if it is currently in use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pcbsd-utils/pc-sysconfig/daemon/Backend-remdev.cpp

    rd08c14d r5281ab9  
    204204  //  - If CD/DVD, try to determine the full type (empty/audio/video/data) 
    205205  if(type=="CD"){ 
     206           
    206207    if(fs=="CD9660"){  
    207208      type = "CD-DATA"; //data CD 
     
    213214    }else{ 
    214215      //No filesystem, so it must be either nothing or an audio CD 
    215       QStringList cdinfo = runShellCommand("cd-info -T --no-cddb --no-device-info  --no-disc-mode --dvd --no-header -q /dev/"+node); 
    216       if( !cdinfo.filter("TRACK").filter("1").isEmpty() ){type = "CD-AUDIO"; } 
     216      //QStringList cdinfo = runShellCommand("cd-info -T --no-cddb --no-device-info  --no-disc-mode --dvd --no-header -q /dev/"+node); 
     217      //if( !cdinfo.filter("TRACK").filter("1").isEmpty() ){type = "CD-AUDIO"; } 
     218             
     219      //cdparanoia is much better about not disturbing the cd if it is running than cdinfo 
     220      QStringList cdinfo = runShellCommand("cdparanoia -Q -d /dev/"+node); 
     221      if( !cdinfo.filter("(audio tracks only)").isEmpty() ){ type = "CD-AUDIO"; } 
    217222      else{ type = "CD-NONE"; } 
    218223    } 
     
    249254         if(!label.isEmpty() && node.contains("s")){ label.append("-"+node.section("s",-1)); } 
    250255      } 
    251       if(label.isEmpty()){ 
    252         label = generateGenericLabel(type); //final option - just create a generic name 
    253       } 
    254     } 
    255   } 
     256    } 
     257  } 
     258  if(label.isEmpty()){ 
     259    label = generateGenericLabel(type); //final option - just create a generic name 
     260  } 
     261 
    256262  if(fs.isEmpty()){ fs = "NONE"; } 
    257263  //Format the output 
     
    320326    bool good = info.simplified()!=(fulldev + ": data"); 
    321327    if(good){ good = !info.contains("(Device not configured)"); } //special output when nothing actually in the tray 
    322     if(good && type.startsWith("CD")){ good = !info.contains("(Invalid argument)"); } //other output when nothing actually in the tray 
     328    if(good && !type.startsWith("CD")){ good = !info.contains("(Invalid argument)"); } //other output when nothing actually in the tray 
    323329    return good;  
    324330  }else if(type=="ISO"){ 
Note: See TracChangeset for help on using the changeset viewer.