Skip to content

Commit 92662e2

Browse files
authored
Merge pull request #14 from arigit/master
Add support for audio files of more than 2GB (find_frames function); fixes #13
2 parents bcfd472 + fdf94bc commit 92662e2

14 files changed

Lines changed: 17 additions & 17 deletions

File tree

Scan.xs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typedef struct {
5656
char* type;
5757
int (*get_tags)(PerlIO *infile, char *file, HV *info, HV *tags);
5858
int (*get_fileinfo)(PerlIO *infile, char *file, HV *tags);
59-
int (*find_frame)(PerlIO *infile, char *file, int offset);
59+
off_t (*find_frame)(PerlIO *infile, char *file, int offset);
6060
int (*find_frame_return_info)(PerlIO *infile, char *file, int offset, HV *info);
6161
} taghandler;
6262

@@ -268,7 +268,7 @@ CODE:
268268
OUTPUT:
269269
RETVAL
270270

271-
int
271+
IV
272272
_find_frame( char *dummy, char *suffix, PerlIO *infile, SV *path, int offset )
273273
CODE:
274274
{

include/asf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,5 +218,5 @@ void _parse_content_encryption(asfinfo *asf);
218218
void _parse_extended_content_encryption(asfinfo *asf);
219219
void _parse_script_command(asfinfo *asf);
220220
SV *_parse_picture(asfinfo *asf, uint32_t picture_offset);
221-
int asf_find_frame(PerlIO *infile, char *file, int offset);
221+
off_t asf_find_frame(PerlIO *infile, char *file, int offset);
222222
int _timestamp(asfinfo *asf, int offset, int *duration);

include/mp3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int sample_rate_tbl[ ] = {
225225

226226
int get_mp3tags(PerlIO *infile, char *file, HV *info, HV *tags);
227227
int get_mp3fileinfo(PerlIO *infile, char *file, HV *info);
228-
int mp3_find_frame(PerlIO *infile, char *file, int offset);
228+
off_t mp3_find_frame(PerlIO *infile, char *file, int offset);
229229

230230
mp3info * _mp3_parse(PerlIO *infile, char *file, HV *info);
231231
int _decode_mp3_frame(unsigned char *bptr, struct mp3frame *frame);

include/mp4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ typedef struct mp4info {
123123
} mp4info;
124124

125125
static int get_mp4tags(PerlIO *infile, char *file, HV *info, HV *tags);
126-
int mp4_find_frame(PerlIO *infile, char *file, int offset);
126+
off_t mp4_find_frame(PerlIO *infile, char *file, int offset);
127127
int mp4_find_frame_return_info(PerlIO *infile, char *file, int offset, HV *info);
128128

129129
mp4info * _mp4_parse(PerlIO *infile, char *file, HV *info, HV *tags, uint8_t seeking);

include/ogf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
int get_ogf_metadata(PerlIO *infile, char *file, HV *info, HV *tags);
1818
int ogf_find_frame_return_info(PerlIO *infile, char *file, int offset, HV *info);
19-
int ogf_find_frame(PerlIO *infile, char *file, int offset);
19+
off_t ogf_find_frame(PerlIO *infile, char *file, int offset);
2020

2121
static int _ogf_parse(PerlIO *infile, char *file, HV *info, HV *tags, uint8_t seeking);
22-
static int _ogf_find_frame(PerlIO *infile, char *file, int offset, HV *info, HV *tags);
22+
static off_t _ogf_find_frame(PerlIO *infile, char *file, int offset, HV *info, HV *tags);

include/ogg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020

2121
int get_ogg_metadata(PerlIO *infile, char *file, HV *info, HV *tags);
2222
int _ogg_parse(PerlIO *infile, char *file, HV *info, HV *tags, uint8_t seeking);
23-
static int ogg_find_frame(PerlIO *infile, char *file, int offset);
23+
static off_t ogg_find_frame(PerlIO *infile, char *file, int offset);
2424
void _parse_vorbis_comments(PerlIO *infile, Buffer *vorbis_buf, HV *tags, int has_framing);
2525
int _ogg_binary_search_sample(PerlIO *infile, char *file, HV *info, uint64_t target_sample);

include/opus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818

1919
int get_opus_metadata(PerlIO *infile, char *file, HV *info, HV *tags);
2020
int _opus_parse(PerlIO *infile, char *file, HV *info, HV *tags, uint8_t seeking);
21-
static int opus_find_frame(PerlIO *infile, char *file, int offset);
21+
static off_t opus_find_frame(PerlIO *infile, char *file, int offset);
2222
void _parse_vorbis_comments(PerlIO *infile, Buffer *vorbis_buf, HV *tags, int has_framing);
2323
int _opus_binary_search_sample(PerlIO *infile, char *file, HV *info, uint64_t target_sample);

src/asf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ _parse_picture(asfinfo *asf, uint32_t picture_offset)
14951495

14961496
// offset is in ms
14971497
// Based on some code from Rockbox
1498-
int
1498+
off_t
14991499
asf_find_frame(PerlIO *infile, char *file, int time_offset)
15001500
{
15011501
int frame_offset = -1;

src/flac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ _flac_parse(PerlIO *infile, char *file, HV *info, HV *tags, uint8_t seeking)
270270

271271
// offset is in ms, does sample-accurate seeking, using seektable if available
272272
// based on libFLAC seek_to_absolute_sample_
273-
static int
273+
static off_t
274274
flac_find_frame(PerlIO *infile, char *file, int offset)
275275
{
276276
off_t frame_offset = -1;

src/mp3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ _mp3_parse(PerlIO *infile, char *file, HV *info)
903903
return mp3;
904904
}
905905

906-
int
906+
off_t
907907
mp3_find_frame(PerlIO *infile, char *file, int offset)
908908
{
909909
Buffer mp3_buf;

0 commit comments

Comments
 (0)