Skip to content

Commit b9ba7f5

Browse files
committed
Merge commit 'db4dfff9e11c516ae35d87e568f511002ddae9d7'
2 parents 8783459 + db4dfff commit b9ba7f5

File tree

5 files changed

+83
-18
lines changed

5 files changed

+83
-18
lines changed

.circleci/config.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
# To see the list of pre-built images that CircleCI provides for most common languages see
2828
# https://circleci.com/docs/2.0/circleci-images/
2929
docker:
30-
- image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
31-
command: /sbin/init
30+
- image: circleci/buildpack-deps:disco
3231
steps:
3332
# Machine Setup
3433
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
@@ -51,14 +50,14 @@ jobs:
5150
- restore_cache:
5251
keys:
5352
# This branch if available
54-
- v1-dep-{{ .Branch }}-
53+
- v2-dependencies-{{ .Branch }}-
5554
# Default branch if not
56-
- v1-dep-master-
55+
- v2-dependencies-master-
5756
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
58-
- v1-dep-
57+
- v2-dependencies-
5958
# Save dependency cache
6059
- save_cache:
61-
key: v1-dep-{{ .Branch }}-{{ epoch }}
60+
key: v2-dependencies-{{ .Branch }}-{{ epoch }}
6261
paths:
6362
# This is a broad list of cache paths to include many possible development environments
6463
# You can probably delete some of these entries

include/cdio/paranoia/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
cdio_paranoia_includedir=$(includedir)/cdio/paranoia
7-
dist_cdio_paranoia_include_HEADERS = cdda.h paranoia.h
7+
dist_cdio_paranoia_include_HEADERS = cdda.h paranoia.h toc.h
88

99
EXTRA_DIST = version.h.in
1010
BUILT_SOURCES = version.h

include/cdio/paranoia/toc.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
Copyright (C) 2019
3+
Rocky Bernstein <[email protected]>
4+
*/
5+
6+
/** \file toc.h
7+
*
8+
* \brief Information from a CDROM TOC relevant to CD-DA disks
9+
******************************************************************/
10+
11+
#ifndef CDIO__PARANOIA__TOC_H_
12+
#define CDIO__PARANOIA__TOC_H_
13+
14+
#include <cdio/cdio.h>
15+
16+
#ifdef __cplusplus
17+
extern "C" {
18+
#endif /* __cplusplus */
19+
20+
/** cdrom_paranoia is an opaque structure which is used in all of the
21+
library operations.
22+
*/
23+
typedef struct cdrom_paranoia_s cdrom_paranoia_t;
24+
typedef struct cdrom_drive_s cdrom_drive_t;
25+
26+
/*! Return the track containing the given LSN. If the LSN is before
27+
the first track (in the pregap), 0 is returned. If there was an
28+
error or the LSN after the LEADOUT (beyond the end of the CD), then
29+
CDIO_INVALID_TRACK is returned.
30+
*/
31+
extern int cdio_cddap_sector_gettrack(cdrom_drive_t *d, lsn_t lsn);
32+
33+
/*! Return the number of channels in track: 2 or 4; -2 if not
34+
implemented or -1 for error.
35+
Not meaningful if track is not an audio track.
36+
*/
37+
extern int cdio_cddap_track_channels(cdrom_drive_t *d, track_t i_track);
38+
39+
/*! Return 1 is track is an audio track, 0 otherwise. */
40+
extern int cdio_cddap_track_audiop(cdrom_drive_t *d, track_t i_track);
41+
42+
/*! Return 1 is track has copy permit set, 0 otherwise. */
43+
extern int cdio_cddap_track_copyp(cdrom_drive_t *d, track_t i_track);
44+
45+
/*! Return 1 is audio track has linear preemphasis set, 0 otherwise.
46+
Only makes sense for audio tracks.
47+
*/
48+
extern int cdio_cddap_track_preemp(cdrom_drive_t *d, track_t i_track);
49+
50+
/*! Get first lsn of the first audio track. -1 is returned on error. */
51+
extern lsn_t cdio_cddap_disc_firstsector(cdrom_drive_t *d);
52+
53+
/*! Get last lsn of the last audio track. The last lsn is generally one
54+
less than the start of the next track after the audio track. -1 is
55+
returned on error. */
56+
extern lsn_t cdio_cddap_disc_lastsector(cdrom_drive_t *d);
57+
58+
#ifdef __cplusplus
59+
}
60+
#endif
61+
62+
#endif /*CDIO__PARANOIA__TOC_H_*/

lib/cdda_interface/toc.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2005, 2008, 2013 Rocky Bernstein <[email protected]>
2+
Copyright (C) 2005, 2008, 2013, 2019 Rocky Bernstein <[email protected]>
33
Copyright (C) 1998-2008 Monty [email protected]
44
derived from code (C) 1994-1996 Heiko Eissfeldt
55
@@ -27,6 +27,7 @@
2727

2828
#include "low_interface.h"
2929
#include "utils.h"
30+
#include <cdio/paranoia/toc.h>
3031

3132
/*! Return the lsn for the start of track i_track or CDIO_LEADOUT_TRACK */
3233
lsn_t
@@ -165,7 +166,7 @@ cdda_tracks(cdrom_drive_t *d)
165166
CDIO_INVALID_TRACK is returned.
166167
*/
167168
int
168-
cdda_sector_gettrack(cdrom_drive_t *d, lsn_t lsn)
169+
cdio_cddap_sector_gettrack(cdrom_drive_t *d, lsn_t lsn)
169170
{
170171
if (!d->opened) {
171172
cderror(d,"400: Device not open\n");
@@ -182,23 +183,23 @@ cdda_sector_gettrack(cdrom_drive_t *d, lsn_t lsn)
182183
implemented or -1 for error.
183184
Not meaningful if track is not an audio track.
184185
*/
185-
int
186-
cdda_track_channels(cdrom_drive_t *d, track_t i_track)
186+
extern int
187+
cdio_cddap_track_channels(cdrom_drive_t *d, track_t i_track)
187188
{
188189
return(cdio_get_track_channels(d->p_cdio, i_track));
189190
}
190191

191192
/*! Return 1 is track is an audio track, 0 otherwise. */
192-
int
193-
cdda_track_audiop(cdrom_drive_t *d, track_t i_track)
193+
extern int
194+
cdio_cddap_track_audiop(cdrom_drive_t *d, track_t i_track)
194195
{
195196
track_format_t track_format = cdio_get_track_format(d->p_cdio, i_track);
196197
return TRACK_FORMAT_AUDIO == track_format ? 1 : 0;
197198
}
198199

199200
/*! Return 1 is track is an audio track, 0 otherwise. */
200-
int
201-
cdda_track_copyp(cdrom_drive_t *d, track_t i_track)
201+
extern int
202+
cdio_cddap_track_copyp(cdrom_drive_t *d, track_t i_track)
202203
{
203204
track_flag_t track_flag = cdio_get_track_copy_permit(d->p_cdio, i_track);
204205
return CDIO_TRACK_FLAG_TRUE == track_flag ? 1 : 0;
@@ -207,8 +208,8 @@ cdda_track_copyp(cdrom_drive_t *d, track_t i_track)
207208
/*! Return 1 is audio track has linear preemphasis set, 0 otherwise.
208209
Only makes sense for audio tracks.
209210
*/
210-
int
211-
cdda_track_preemp(cdrom_drive_t *d, track_t i_track)
211+
extern int
212+
cdio_cddap_track_preemp(cdrom_drive_t *d, track_t i_track)
212213
{
213214
track_flag_t track_flag = cdio_get_track_preemphasis(d->p_cdio, i_track);
214215
return CDIO_TRACK_FLAG_TRUE == track_flag ? 1 : 0;

src/cd-paranoia.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,10 @@ main(int argc,char *argv[])
14871487
" \r%s%s\n",
14881488
mes?mes:"",err?err:"");
14891489

1490-
if(err)free(err);if(mes)free(mes);
1490+
if (err)
1491+
free(err);
1492+
if (mes)
1493+
free(mes);
14911494
if(readbuf==NULL){
14921495
skipped_flag=1;
14931496
report("\nparanoia_read: Unrecoverable error reading through "

0 commit comments

Comments
 (0)