Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package cdemu-daemon for openSUSE:Factory checked in at 2024-09-10 21:13:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cdemu-daemon (Old) and /work/SRC/openSUSE:Factory/.cdemu-daemon.new.17570 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cdemu-daemon" Tue Sep 10 21:13:59 2024 rev:31 rq:1199825 version:3.2.7 Changes: -------- --- /work/SRC/openSUSE:Factory/cdemu-daemon/cdemu-daemon.changes 2024-03-15 20:31:09.815821743 +0100 +++ /work/SRC/openSUSE:Factory/.cdemu-daemon.new.17570/cdemu-daemon.changes 2024-09-10 21:15:28.459639685 +0200 @@ -1,0 +2,8 @@ +Sun Aug 18 23:38:07 UTC 2024 - Jan Engelhardt <[email protected]> + +- Update to release 3.2.7 + * ``READ SUBCHANNEL`` command fixes + * Implement ``SEEK`` command + * Adjust error codes returned by read commands + +------------------------------------------------------------------- Old: ---- cdemu-daemon-3.2.6.tar.xz New: ---- _scmsync.obsinfo cdemu-daemon-3.2.7.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cdemu-daemon.spec ++++++ --- /var/tmp/diff_new_pack.pu8pdR/_old 2024-09-10 21:15:28.963660686 +0200 +++ /var/tmp/diff_new_pack.pu8pdR/_new 2024-09-10 21:15:28.963660686 +0200 @@ -22,7 +22,7 @@ %endif Name: cdemu-daemon -Version: 3.2.6 +Version: 3.2.7 Release: 0 Summary: Device daemon for cdemu, a virtual CD-ROM device emulator License: GPL-2.0-or-later ++++++ _scmsync.obsinfo ++++++ mtime: 1724024391 commit: e0a17a15e21b9ed71c6853788ca3ab9c1c8375c894ae629c97f0bd38a8d0a395 url: https://src.opensuse.org/jengelh/cdemu-daemon revision: master ++++++ cdemu-daemon-3.2.6.tar.xz -> cdemu-daemon-3.2.7.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.6/CMakeLists.txt new/cdemu-daemon-3.2.7/CMakeLists.txt --- old/cdemu-daemon-3.2.6/CMakeLists.txt 2021-12-18 12:18:52.000000000 +0100 +++ new/cdemu-daemon-3.2.7/CMakeLists.txt 2024-07-08 20:43:55.000000000 +0200 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.7) -project(cdemu-daemon VERSION 3.2.6 LANGUAGES C) +project(cdemu-daemon VERSION 3.2.7 LANGUAGES C) # Additional CMake modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.6/README new/cdemu-daemon-3.2.7/README --- old/cdemu-daemon-3.2.6/README 2021-12-18 12:18:52.000000000 +0100 +++ new/cdemu-daemon-3.2.7/README 2024-07-08 20:43:55.000000000 +0200 @@ -1,5 +1,5 @@ CDEmu Daemon -3.2.6 +3.2.7 ~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.6/debian/changelog new/cdemu-daemon-3.2.7/debian/changelog --- old/cdemu-daemon-3.2.6/debian/changelog 2021-12-18 12:18:52.000000000 +0100 +++ new/cdemu-daemon-3.2.7/debian/changelog 2024-07-08 20:43:55.000000000 +0200 @@ -1,3 +1,3 @@ -cdemu-daemon (3.2.6-1) debian; urgency=low +cdemu-daemon (3.2.7-1) debian; urgency=low * Initial Release. Closes: #705409 -- Henrik Stokseth <[email protected]> Sat, 05 Apr 2014 12:00:00 +0100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.6/debian/compat new/cdemu-daemon-3.2.7/debian/compat --- old/cdemu-daemon-3.2.6/debian/compat 2021-12-18 12:18:52.000000000 +0100 +++ new/cdemu-daemon-3.2.7/debian/compat 2024-07-08 20:43:55.000000000 +0200 @@ -1 +1 @@ -9 +10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.6/debian/control new/cdemu-daemon-3.2.7/debian/control --- old/cdemu-daemon-3.2.6/debian/control 2021-12-18 12:18:52.000000000 +0100 +++ new/cdemu-daemon-3.2.7/debian/control 2024-07-08 20:43:55.000000000 +0200 @@ -4,7 +4,7 @@ Homepage: http://cdemu.sourceforge.net/ Maintainer: Henrik Stokseth <[email protected]> Build-Depends: libglib2.0-dev (>= 2.38), libao-dev (>= 0.8.0), - libmirage11-dev (>= 3.2.0), debhelper (>= 9), intltool, + libmirage11-dev (>= 3.2.0), debhelper (>= 10), intltool, cmake (>= 3.7.0) Standards-Version: 4.3.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cdemu-daemon-3.2.6/src/device-commands.c new/cdemu-daemon-3.2.7/src/device-commands.c --- old/cdemu-daemon-3.2.6/src/device-commands.c 2021-12-18 12:18:52.000000000 +0100 +++ new/cdemu-daemon-3.2.7/src/device-commands.c 2024-07-08 20:43:55.000000000 +0200 @@ -1038,7 +1038,7 @@ if (!sector) { CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: failed to read sector: %s\n", __debug__, error->message); g_error_free(error); - cdemu_device_write_sense_full(self, ILLEGAL_REQUEST, ILLEGAL_MODE_FOR_THIS_TRACK, 0, address); + cdemu_device_write_sense_full(self, ILLEGAL_REQUEST, LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE, 0, address); return FALSE; } @@ -1234,7 +1234,7 @@ if (!first_sector) { CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: failed to get start sector: %s\n", __debug__, error->message); g_error_free(error); - cdemu_device_write_sense_full(self, ILLEGAL_REQUEST, ILLEGAL_MODE_FOR_THIS_TRACK, 0, start_address); + cdemu_device_write_sense_full(self, ILLEGAL_REQUEST, LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE, 0, start_address); return FALSE; } prev_sector_type = mirage_sector_get_sector_type(first_sector); @@ -1254,7 +1254,7 @@ if (!sector) { CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: failed to get sector: %s!\n", __debug__, error->message); g_error_free(error); - cdemu_device_write_sense_full(self, ILLEGAL_REQUEST, ILLEGAL_MODE_FOR_THIS_TRACK, 0, address); + cdemu_device_write_sense_full(self, ILLEGAL_REQUEST, LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE, 0, address); return FALSE; } @@ -1623,8 +1623,9 @@ We do the same, because at least 'grip' on linux seems to rely on data returned by READ SUBCHANNEL being HEX... (and it seems MMC3 requires READ CD to return BCD data) */ - gint correction = 1; + gint correction = 0; while ((tmp_buf[0] & 0x0F) != 0x01) { + correction++; CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: got a sector that's not Mode-1 Q; taking next one (0x%X)!\n", __debug__, current_address+correction); /* Read from next sector */ @@ -1632,26 +1633,39 @@ CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: failed to read subchannel of sector 0x%X!\n", __debug__, current_address+correction); break; } - - correction++; } /* In Q-subchannel, first MSF is relative, second absolute... in data we return, it's the other way around */ - gint relative_address = mirage_helper_msf2lba(mirage_helper_bcd2hex(tmp_buf[3]), mirage_helper_bcd2hex(tmp_buf[4]), mirage_helper_bcd2hex(tmp_buf[5]), FALSE) - correction; - gint absolute_address = mirage_helper_msf2lba(mirage_helper_bcd2hex(tmp_buf[7]), mirage_helper_bcd2hex(tmp_buf[8]), mirage_helper_bcd2hex(tmp_buf[9]), TRUE) - correction; + guint8 rmin = mirage_helper_bcd2hex(tmp_buf[3]); + guint8 rsec = mirage_helper_bcd2hex(tmp_buf[4]); + guint8 rframe = mirage_helper_bcd2hex(tmp_buf[5]); + + guint8 amin = mirage_helper_bcd2hex(tmp_buf[7]); + guint8 asec = mirage_helper_bcd2hex(tmp_buf[8]); + guint8 aframe = mirage_helper_bcd2hex(tmp_buf[9]); + + if (correction != 0) { + gint relative_address = mirage_helper_msf2lba(rmin, rsec, rframe, FALSE) - correction; + gint absolute_address = mirage_helper_msf2lba(amin, asec, aframe, TRUE) - correction; + mirage_helper_lba2msf(relative_address, FALSE, &rmin, &rsec, &rframe); + mirage_helper_lba2msf(absolute_address, TRUE, &amin, &asec, &aframe); + } /* MSF vs. LBA */ if (cdb->time) { guint8 *msf_ptr = (guint8 *)&ret_data->abs_addr; - - mirage_helper_lba2msf(absolute_address, TRUE, &msf_ptr[1], &msf_ptr[2], &msf_ptr[3]); + msf_ptr[1] = amin; + msf_ptr[2] = asec; + msf_ptr[3] = aframe; msf_ptr = (guint8 *)&ret_data->rel_addr; - mirage_helper_lba2msf(relative_address, FALSE, &msf_ptr[1], &msf_ptr[2], &msf_ptr[3]); + msf_ptr[1] = rmin; + msf_ptr[2] = rsec; + msf_ptr[3] = rframe; } else { - ret_data->abs_addr = GUINT32_TO_BE(absolute_address); - ret_data->rel_addr = GUINT32_TO_BE(relative_address); + ret_data->abs_addr = GUINT32_TO_BE(mirage_helper_msf2lba(amin, asec, aframe, TRUE)); + ret_data->rel_addr = GUINT32_TO_BE(mirage_helper_msf2lba(rmin, rsec, rframe, FALSE)); } break; @@ -1746,7 +1760,7 @@ /* Header */ ret_header->audio_status = cdemu_audio_get_status(CDEMU_AUDIO(self->priv->audio_play)); /* Audio status */ - ret_header->length = GUINT32_TO_BE(self->priv->buffer_size - 4); + ret_header->length = GUINT16_TO_BE(self->priv->buffer_size - 4); /* Write data */ cdemu_device_write_buffer(self, GUINT16_FROM_BE(cdb->length)); @@ -2497,10 +2511,40 @@ /* SEEK (10)*/ -static gboolean command_seek (CdemuDevice *self, const guint8 *raw_cdb G_GNUC_UNUSED) +static gboolean command_seek (CdemuDevice *self, const guint8 *raw_cdb) { - /*struct SET_CD_SPEED_CDB *cdb = (struct SET_CD_SPEED_CDB *)raw_cdb;*/ - CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: nothing to do here yet...\n", __debug__); + struct SEEK_10_CDB *cdb = (struct SEEK_10_CDB *)raw_cdb; + gint target_address = GUINT32_FROM_BE(cdb->lba); + CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: seeking to sector 0x%X\n", __debug__, target_address); + + /* Check if we have medium loaded */ + if (!self->priv->loaded) { + CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: medium not present\n", __debug__); + cdemu_device_write_sense(self, NOT_READY, MEDIUM_NOT_PRESENT); + return FALSE; + } + + /* Set up delay emulation (0 sectors since we're not actually reading data) */ + cdemu_device_delay_begin(self, target_address, 0); + + MirageDisc *disc = self->priv->disc; + GError *error = NULL; + MirageSector *sector = mirage_disc_get_sector(disc, target_address, &error); + if (!sector) { + CDEMU_DEBUG(self, DAEMON_DEBUG_MMC, "%s: failed to get sector: %s\n", __debug__, error->message); + g_error_free(error); + cdemu_device_write_sense_full(self, ILLEGAL_REQUEST, LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE, 0, target_address); + return FALSE; + } + + self->priv->current_address = target_address; + + /* Release sector */ + g_object_unref(sector); + + /* Perform delay emulation */ + cdemu_device_delay_finalize(self); + return TRUE; }
