~ubuntu-branches/ubuntu/maverick/brasero/maverick

« back to all changes in this revision

Viewing changes to libbrasero-media/brasero-medium.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2010-07-04 15:14:24 UTC
  • mfrom: (1.3.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: james.westby@ubuntu.com-20100704151424-yg69h5sc55xgjp6h
Tags: 2.30.2-1
* New upstream release.
  - Fixes incorrectly reported size by passing correct arguments to
    g_signal_emit(). Closes: #568606
  - Fixes tracker search support. Closes: #465238
* debian/patches/90_relibtoolize.patch
  - Refresh for new upstream release.
* Switch to source formate 3.0 (quilt)
  - Add debian/source/format.
  - Drop Build-Depends on quilt.
  - Remove /usr/share/cdbs/1/rules/patchsys-quilt.mk from debian/rules.
* Bump-Standards-Version to 3.9.0
  - Use architecture wildcard kfreebsd-any for the libcam-dev Build-Depends.
  - Use Breaks instead of Conflicts as recommended by the new policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1480
1480
 
1481
1481
        desc = page_2A->wr_spd_desc;
1482
1482
        for (i = 0; i < desc_num; i ++) {
 
1483
                /* It happens (I have such a drive) that it returns descriptors
 
1484
                 * with the same speeds each (in this case the maximum) */
 
1485
                if (i > 0 && priv->wr_speeds [i-1] == BRASERO_GET_16 (desc [i].speed))
 
1486
                        continue;
 
1487
 
1483
1488
                priv->wr_speeds [i] = BRASERO_GET_16 (desc [i].speed);
1484
1489
                max_wrt = MAX (max_wrt, priv->wr_speeds [i]);
1485
1490
        }
1567
1572
                                  int track_num,
1568
1573
                                  int track_start)
1569
1574
{
 
1575
        BraseroScsiErrCode error = BRASERO_SCSI_ERROR_NONE;
1570
1576
        unsigned char buffer [2048];
1571
1577
        BraseroScsiResult result;
1572
1578
 
1573
1579
        BRASERO_MEDIA_LOG ("Checking for TDBs in track pregap.");
1574
1580
 
1575
 
        /* The two following sectors are readable */
 
1581
        /* To avoid blocking try to check whether it is readable */
 
1582
        result = brasero_mmc1_read_block (handle,
 
1583
                                          TRUE,
 
1584
                                          BRASERO_SCSI_BLOCK_TYPE_ANY,
 
1585
                                          BRASERO_SCSI_BLOCK_HEADER_NONE,
 
1586
                                          BRASERO_SCSI_BLOCK_NO_SUBCHANNEL,
 
1587
                                          track_start - 1,
 
1588
                                          1,
 
1589
                                          NULL,
 
1590
                                          0,
 
1591
                                          &error);
 
1592
        if (result != BRASERO_SCSI_OK || error != BRASERO_SCSI_ERROR_NONE)
 
1593
                return TRUE;
 
1594
 
1576
1595
        result = brasero_mmc1_read_block (handle,
1577
1596
                                          TRUE,
1578
1597
                                          BRASERO_SCSI_BLOCK_TYPE_ANY,
1582
1601
                                          1,
1583
1602
                                          buffer,
1584
1603
                                          sizeof (buffer),
1585
 
                                          NULL);
1586
 
 
1587
 
        if (result == BRASERO_SCSI_OK) {
 
1604
                                          &error);
 
1605
        if (result == BRASERO_SCSI_OK && error == BRASERO_SCSI_ERROR_NONE) {
1588
1606
                int i;
1589
1607
 
1590
1608
                if (buffer [0] != 'T' || buffer [1] != 'D' || buffer [2] != 'I') {
1699
1717
             &&  (priv->info & BRASERO_MEDIUM_CD)
1700
1718
             && !(priv->info & BRASERO_MEDIUM_ROM)) {
1701
1719
                BRASERO_MEDIA_LOG ("Data track belongs to first session of multisession CD. "
1702
 
                                  "Checking for real size (%i sectors currently).",
1703
 
                                  track->blocks_num);
 
1720
                                   "Checking for real size (%i sectors currently).",
 
1721
                                   track->blocks_num);
1704
1722
 
1705
1723
                /* we test the pregaps blocks for TDB: these are special blocks
1706
1724
                 * filling the pregap of a track when it was recorded as TAO or
2010
2028
        BRASERO_MEDIA_LOG ("Reading Toc");
2011
2029
 
2012
2030
        priv = BRASERO_MEDIUM_PRIVATE (self);
 
2031
 
 
2032
tryagain:
 
2033
 
2013
2034
        result = brasero_mmc1_read_toc_formatted (handle,
2014
2035
                                                  0,
2015
2036
                                                  &toc,
2020
2041
                return FALSE;
2021
2042
        }
2022
2043
 
 
2044
        if (priv->probe_cancelled) {
 
2045
                g_free (toc);
 
2046
                return FALSE;
 
2047
        }
 
2048
 
 
2049
        /* My drive with some Video CDs gets a size of 2 (basically the size
 
2050
         * member of the structure) without any error. Consider the drive is not
 
2051
         * ready and needs retrying */
 
2052
        if (size < sizeof (BraseroScsiFormattedTocData)) {
 
2053
                g_free (toc);
 
2054
                toc = NULL;
 
2055
                goto tryagain;
 
2056
        }
 
2057
 
2023
2058
        num = (size - sizeof (BraseroScsiFormattedTocData)) /
2024
2059
               sizeof (BraseroScsiTocDesc);
2025
2060
 
3048
3083
 
3049
3084
        g_mutex_lock (priv->mutex);
3050
3085
 
 
3086
        priv->probe = NULL;
3051
3087
        if (!priv->probe_cancelled)
3052
3088
                priv->probe_id = g_idle_add (brasero_medium_probed, self);
3053
3089
 
3054
 
        priv->probe = NULL;
3055
3090
        g_cond_broadcast (priv->cond);
3056
3091
        g_mutex_unlock (priv->mutex);
3057
3092