After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 148274 - Get disc size
Get disc size
Status: RESOLVED FIXED
Product: nautilus-cd-burner
Classification: Deprecated
Component: cd-burner
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus CD Burner Maintainers
Nautilus CD Burner Maintainers
Depends on:
Blocks: 135985
 
 
Reported: 2004-07-23 14:17 UTC by Fernando Herrera
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch adding size functions and moving read/write speed discovering to MMC instead of cdrecord -prcap (10.60 KB, patch)
2004-07-23 14:19 UTC, Fernando Herrera
none Details | Review
Updated patch (10.79 KB, patch)
2004-07-23 16:58 UTC, Fernando Herrera
none Details | Review

Description Fernando Herrera 2004-07-23 14:17:07 UTC
Attached patch implements
cd_drive_get_media_size_from_path and cd_drive_get_media_size using ATIP MMC
command. It also adds a read/write MMC function and moves cd-drive to it.
Comment 1 Fernando Herrera 2004-07-23 14:19:25 UTC
Created attachment 29830 [details] [review]
Patch adding size functions and moving read/write speed discovering to MMC instead of cdrecord -prcap

Notice that "cdrecord -prcap" is still used in non-linux in get_cd_properties
for getting drive_cap. This should be also moved to MMC commands.
Comment 2 Bastien Nocera 2004-07-23 14:27:53 UTC
CD_MEDIA_SIZE_UNKNOWN should be negative.
I'd rather get_disc_size returned the media size in whatever format, so that we
can also gather the size in megs rather than convert from atip to minutes then megs.
Comment 3 Fernando Herrera 2004-07-23 16:58:05 UTC
Created attachment 29834 [details] [review]
Updated patch

I've put UNKNOWN_SIZE to -1, but I haven't changed the format of retrieved atip
information, because that is the only that atip returns: mins, secs,
start_frame. Frames should be calculated like (secs + 150 ) * 75, so it doesn't
make sense. I've added a macro to convert secs to megs, that it is not 100%
accurate (notice that 700 Mg = 80 mins, 650 Mg = 74 mins are not equivalent). 

cdrecord is also getting disc size from this mins+secs atip field but to check
if tracks will fit on current space, it converts secs+mins to frames, and then
does some tack size calculation (pregap, etc...)

Maybe a cdrecorder_calculate_tracks_size with this code ripped would be
insteresting.
Comment 4 Bastien Nocera 2004-07-23 22:21:00 UTC
Simply add some printf's to print out the size of the current medium, if there's
one, and you're OK to commit.

Cheers
Comment 5 Bastien Nocera 2004-07-26 11:35:21 UTC
2004-07-26  Bastien Nocera  <hadess@hadess.net>
                                                                               
        * list_cddrives.c: (list_cdroms): print out the size, and length in
        minutes/seconds of the media in the drive (Closes: #148274)
                                                                               
2004-07-23  Fernando Herrera  <fherrera@onirica.com>
                                                                               
        * dvd_plus_rw_utils.cpp: MMC functions to get read/write speed
        and blank disc size
        * cd-drive.c: (get_cd_properties):
        (get_device_max_read_speed), (get_device_max_write_speed),
        (add_linux_cd_recorder), (freebsd_scan), (cdrecord_scan):
        Use MMC functions to get speeds.
        (cd_drive_get_media_size_from_path), (cd_drive_get_media_size),
        * cd-drive.h: New functions to get media size.