1 |
sbriesen 08/01/06 02:46:02 |
2 |
|
3 |
Added: dvda-author-20050703-flac113.diff |
4 |
digest-dvda-author-20050703 |
5 |
Log: |
6 |
initial commit, using own patch to use system flac-libs >= 1.1.3 |
7 |
(Portage version: 2.1.4_rc14) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 media-sound/dvda-author/files/dvda-author-20050703-flac113.diff |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/dvda-author/files/dvda-author-20050703-flac113.diff?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/dvda-author/files/dvda-author-20050703-flac113.diff?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: dvda-author-20050703-flac113.diff |
16 |
=================================================================== |
17 |
diff -Naur dvda-author-20050703.orig/src/ats.c dvda-author-20050703/src/ats.c |
18 |
--- dvda-author-20050703.orig/src/ats.c 2007-10-08 23:11:28.000000000 +0200 |
19 |
+++ dvda-author-20050703/src/ats.c 2008-01-03 07:38:57.000000000 +0100 |
20 |
@@ -346,7 +346,7 @@ |
21 |
int write_pes_packet(FILE* fp, fileinfo_t* info, uint8_t* audio_buf, int bytesinbuffer, uint64_t pack_in_title, int pack_in_file, int last_pack) { |
22 |
uint64_t PTS; |
23 |
uint64_t SCR; |
24 |
- int audio_bytes; |
25 |
+ int audio_bytes = 0; |
26 |
static int cc; // Continuity counter - reset to 0 when pack_in_title=0 |
27 |
int lpcm_payload; |
28 |
|
29 |
diff -Naur dvda-author-20050703.orig/src/audio.c dvda-author-20050703/src/audio.c |
30 |
--- dvda-author-20050703.orig/src/audio.c 2007-10-08 23:11:28.000000000 +0200 |
31 |
+++ dvda-author-20050703/src/audio.c 2008-01-03 07:38:57.000000000 +0100 |
32 |
@@ -30,7 +30,7 @@ |
33 |
#include <string.h> |
34 |
#include "audio.h" |
35 |
|
36 |
-void flac_metadata_callback(const FLAC__FileDecoder *dec, const FLAC__StreamMetadata *meta, void *data) { |
37 |
+void flac_metadata_callback(const FLAC__StreamDecoder *dec, const FLAC__StreamMetadata *meta, void *data) { |
38 |
fileinfo_t *info = (fileinfo_t*) data; |
39 |
|
40 |
if (meta->type==FLAC__METADATA_TYPE_STREAMINFO) { |
41 |
@@ -41,7 +41,7 @@ |
42 |
} |
43 |
} |
44 |
|
45 |
-FLAC__StreamDecoderWriteStatus flac_null_write_callback(const FLAC__FileDecoder *dec, |
46 |
+FLAC__StreamDecoderWriteStatus flac_null_write_callback(const FLAC__StreamDecoder *dec, |
47 |
const FLAC__Frame *frame, |
48 |
const FLAC__int32 * const buf[], |
49 |
void *data) |
50 |
@@ -49,7 +49,7 @@ |
51 |
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; |
52 |
} |
53 |
|
54 |
-FLAC__StreamDecoderWriteStatus flac_write_callback(const FLAC__FileDecoder *dec, |
55 |
+FLAC__StreamDecoderWriteStatus flac_write_callback(const FLAC__StreamDecoder *dec, |
56 |
const FLAC__Frame *frame, |
57 |
const FLAC__int32 * const buf[], |
58 |
void *data) |
59 |
@@ -84,7 +84,7 @@ |
60 |
|
61 |
|
62 |
|
63 |
-void flac_error_callback(const FLAC__FileDecoder *dec, |
64 |
+void flac_error_callback(const FLAC__StreamDecoder *dec, |
65 |
FLAC__StreamDecoderErrorStatus status, void *data) |
66 |
{ |
67 |
fprintf(stderr, "ERR: FLAC error callback called.\n"); |
68 |
@@ -133,34 +133,35 @@ |
69 |
} |
70 |
|
71 |
int flac_getinfo(fileinfo_t* info) { |
72 |
- FLAC__FileDecoder* flac; |
73 |
- FLAC__FileDecoderState result; |
74 |
+ FLAC__StreamDecoder* flac; |
75 |
+ FLAC__StreamDecoderState result; |
76 |
|
77 |
- flac=FLAC__file_decoder_new(); |
78 |
+ flac=FLAC__stream_decoder_new(); |
79 |
|
80 |
if (flac==NULL) { |
81 |
fprintf(stderr,"ERR: Fatal error - could not create FLAC decoder\n"); |
82 |
return(1); |
83 |
} |
84 |
- FLAC__file_decoder_set_filename(flac,info->filename); |
85 |
- FLAC__file_decoder_set_client_data(flac,(void*)info); |
86 |
- FLAC__file_decoder_set_write_callback(flac,flac_null_write_callback); |
87 |
- FLAC__file_decoder_set_error_callback(flac,flac_error_callback); |
88 |
- FLAC__file_decoder_set_metadata_callback(flac,flac_metadata_callback); |
89 |
|
90 |
- result=FLAC__file_decoder_init(flac); |
91 |
- if (result!=FLAC__FILE_DECODER_OK) { |
92 |
+ result=FLAC__stream_decoder_init_file(flac, |
93 |
+ info->filename, |
94 |
+ flac_null_write_callback, |
95 |
+ flac_metadata_callback, |
96 |
+ flac_error_callback, |
97 |
+ (void*)info); |
98 |
+ |
99 |
+ if (result!=FLAC__STREAM_DECODER_INIT_STATUS_OK) { |
100 |
fprintf(stderr,"ERR: Failed to initialise FLAC decoder\n"); |
101 |
- FLAC__file_decoder_delete(flac); |
102 |
+ FLAC__stream_decoder_delete(flac); |
103 |
return(1); |
104 |
} |
105 |
|
106 |
- if (!FLAC__file_decoder_process_until_end_of_metadata(flac)) { |
107 |
+ if (!FLAC__stream_decoder_process_until_end_of_metadata(flac)) { |
108 |
fprintf(stderr,"ERR: Failed to read metadata from FLAC file\n"); |
109 |
- FLAC__file_decoder_delete(flac); |
110 |
+ FLAC__stream_decoder_delete(flac); |
111 |
return(1); |
112 |
} |
113 |
- FLAC__file_decoder_finish(flac); |
114 |
+ FLAC__stream_decoder_finish(flac); |
115 |
|
116 |
if (((info->bitspersample!=16) && (info->bitspersample!=24)) || (info->channels > 2)) { |
117 |
return(1); |
118 |
@@ -169,7 +170,7 @@ |
119 |
info->type=AFMT_FLAC; |
120 |
info->numbytes=info->numsamples*info->channels*(info->bitspersample/8); |
121 |
calc_info(info); |
122 |
- FLAC__file_decoder_delete(flac); |
123 |
+ FLAC__stream_decoder_delete(flac); |
124 |
return(0); |
125 |
} |
126 |
|
127 |
@@ -203,7 +204,7 @@ |
128 |
} |
129 |
|
130 |
int audio_open(fileinfo_t* info) { |
131 |
- FLAC__FileDecoderState result; |
132 |
+ FLAC__StreamDecoderState result; |
133 |
|
134 |
info->audio=malloc(sizeof(audio_input_t)); |
135 |
if (info->type==AFMT_WAVE) { |
136 |
@@ -214,7 +215,7 @@ |
137 |
fseek(info->audio->fp,44,SEEK_SET); |
138 |
info->audio->bytesread=0; |
139 |
} else if (info->type==AFMT_FLAC) { |
140 |
- info->audio->flac=FLAC__file_decoder_new(); |
141 |
+ info->audio->flac=FLAC__stream_decoder_new(); |
142 |
info->audio->n=0; |
143 |
info->audio->eos=0; |
144 |
|
145 |
@@ -222,22 +223,23 @@ |
146 |
fprintf(stderr,"ERR: Fatal error - could not create FLAC decoder\n"); |
147 |
return(1); |
148 |
} |
149 |
- FLAC__file_decoder_set_filename(info->audio->flac,info->filename); |
150 |
- FLAC__file_decoder_set_client_data(info->audio->flac,(void*)info); |
151 |
- FLAC__file_decoder_set_write_callback(info->audio->flac,flac_write_callback); |
152 |
- FLAC__file_decoder_set_error_callback(info->audio->flac,flac_error_callback); |
153 |
- FLAC__file_decoder_set_metadata_callback(info->audio->flac,flac_metadata_callback); |
154 |
|
155 |
- result=FLAC__file_decoder_init(info->audio->flac); |
156 |
- if (result!=FLAC__FILE_DECODER_OK) { |
157 |
+ result=FLAC__stream_decoder_init_file(info->audio->flac, |
158 |
+ info->filename, |
159 |
+ flac_write_callback, |
160 |
+ flac_metadata_callback, |
161 |
+ flac_error_callback, |
162 |
+ (void*)info); |
163 |
+ |
164 |
+ if (result!=FLAC__STREAM_DECODER_INIT_STATUS_OK) { |
165 |
fprintf(stderr,"ERR: Failed to initialise FLAC decoder\n"); |
166 |
- FLAC__file_decoder_delete(info->audio->flac); |
167 |
+ FLAC__stream_decoder_delete(info->audio->flac); |
168 |
return(1); |
169 |
} |
170 |
|
171 |
- if (!FLAC__file_decoder_process_until_end_of_metadata(info->audio->flac)) { |
172 |
+ if (!FLAC__stream_decoder_process_until_end_of_metadata(info->audio->flac)) { |
173 |
fprintf(stderr,"ERR: Failed to read metadata from FLAC file\n"); |
174 |
- FLAC__file_decoder_delete(info->audio->flac); |
175 |
+ FLAC__stream_decoder_delete(info->audio->flac); |
176 |
return(1); |
177 |
} |
178 |
} |
179 |
@@ -248,7 +250,7 @@ |
180 |
int audio_read(fileinfo_t* info, uint8_t* buf, int count) { |
181 |
uint32_t i; |
182 |
uint8_t x; |
183 |
- int n; |
184 |
+ int n = 0; |
185 |
int bytesread; |
186 |
FLAC__bool result; |
187 |
|
188 |
@@ -271,12 +273,12 @@ |
189 |
n=bytesread; |
190 |
} else if (info->type==AFMT_FLAC) { |
191 |
while ((info->audio->n < count) && (info->audio->eos==0)) { |
192 |
- result=FLAC__file_decoder_process_single(info->audio->flac); |
193 |
+ result=FLAC__stream_decoder_process_single(info->audio->flac); |
194 |
if (result==0) { |
195 |
fprintf(stderr,"ERR: Fatal error decoding FLAC file\n"); |
196 |
exit(0); |
197 |
} |
198 |
- if (FLAC__file_decoder_get_state(info->audio->flac)==FLAC__FILE_DECODER_END_OF_FILE) { |
199 |
+ if (FLAC__stream_decoder_get_state(info->audio->flac)==FLAC__STREAM_DECODER_END_OF_STREAM) { |
200 |
info->audio->eos=1; |
201 |
} |
202 |
} |
203 |
@@ -369,7 +371,7 @@ |
204 |
if (info->type==AFMT_WAVE) { |
205 |
fclose(info->audio->fp); |
206 |
} else if (info->type==AFMT_FLAC) { |
207 |
- FLAC__file_decoder_delete(info->audio->flac); |
208 |
+ FLAC__stream_decoder_delete(info->audio->flac); |
209 |
} |
210 |
free(info->audio); |
211 |
return(0); |
212 |
diff -Naur dvda-author-20050703.orig/src/audio.h dvda-author-20050703/src/audio.h |
213 |
--- dvda-author-20050703.orig/src/audio.h 2007-10-08 23:11:28.000000000 +0200 |
214 |
+++ dvda-author-20050703/src/audio.h 2008-01-03 07:38:57.000000000 +0100 |
215 |
@@ -30,14 +30,14 @@ |
216 |
|
217 |
#include <stdio.h> |
218 |
#include <stdint.h> |
219 |
-#include "libFLAC/include/FLAC/file_decoder.h" |
220 |
+#include <FLAC/all.h> |
221 |
|
222 |
#define AFMT_WAVE 1 |
223 |
#define AFMT_FLAC 2 |
224 |
|
225 |
typedef struct { |
226 |
FILE* fp; |
227 |
- FLAC__FileDecoder* flac; |
228 |
+ FLAC__StreamDecoder* flac; |
229 |
// Used for FLAC decoding: |
230 |
uint8_t buf[1024*256]; |
231 |
int n; |
232 |
diff -Naur dvda-author-20050703.orig/src/dvda-author.c dvda-author-20050703/src/dvda-author.c |
233 |
--- dvda-author-20050703.orig/src/dvda-author.c 2007-10-08 23:11:28.000000000 +0200 |
234 |
+++ dvda-author-20050703/src/dvda-author.c 2008-01-03 07:38:57.000000000 +0100 |
235 |
@@ -52,7 +52,7 @@ |
236 |
char audiotsdir[540]; |
237 |
char videotsdir[540]; |
238 |
fileinfo_t files[9][99]; |
239 |
- uint64_t totalsize; |
240 |
+ uint64_t totalsize = 0; |
241 |
|
242 |
fprintf(stderr,"dvda-author v" VERSION " - Copyright (C) 2005 Dave Chapman\n"); |
243 |
fprintf(stderr,"Latest version available from http://dvd-audio.sourceforge.net/\n\n"); |
244 |
diff -Naur dvda-author-20050703.orig/src/Makefile dvda-author-20050703/src/Makefile |
245 |
--- dvda-author-20050703.orig/src/Makefile 2007-10-08 23:11:28.000000000 +0200 |
246 |
+++ dvda-author-20050703/src/Makefile 2008-01-03 07:39:25.000000000 +0100 |
247 |
@@ -7,20 +7,16 @@ |
248 |
|
249 |
CC=$(CROSS)gcc |
250 |
AR=$(CROSS)ar |
251 |
-CFLAGS=-Wall |
252 |
-LIBS=-lm |
253 |
+CFLAGS+=-Wall |
254 |
+LIBS=`pkg-config --libs flac` |
255 |
TARGETS=dvda-author$(EXT) |
256 |
OBJS=dvda-author.o audio.o ats.o atsi.o amg.o samg.o |
257 |
|
258 |
-FLACOPTS=-DVERSION=\"1.1.2\" -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA -I libFLAC/include |
259 |
-FLACSRC=$(wildcard libFLAC/*.c) |
260 |
-FLACOBJS=$(FLACSRC:%.c=%.o) |
261 |
- |
262 |
.PHONY: all |
263 |
all: $(TARGETS) |
264 |
|
265 |
-dvda-author$(EXT): $(OBJS) $(FLACOBJS) |
266 |
- $(CC) $(CFLAGS) $(LIBS) -o $@ $^ |
267 |
+dvda-author$(EXT): $(OBJS) |
268 |
+ $(CC) $(LIBS) $(LDFLAGS) -o $@ $^ |
269 |
|
270 |
dvda-author.o: dvda-author.c version.h audio.h ats.h atsi.h |
271 |
ats.o: ats.c ats.h audio.h |
272 |
@@ -29,9 +25,6 @@ |
273 |
atsi.o: atsi.c atsi.h audio.h |
274 |
audio.o: audio.c audio.h |
275 |
|
276 |
-libFLAC/%.o: libFLAC/%.c |
277 |
- $(CC) $(CFLAGS) $(FLACOPTS) -c -o $@ $< |
278 |
- |
279 |
.PHONY: clean |
280 |
clean: |
281 |
- rm -f $(TARGETS) $(OBJS) $(FLACOBJS) *~ |
282 |
+ rm -f $(TARGETS) $(OBJS) *~ |
283 |
|
284 |
|
285 |
|
286 |
1.1 media-sound/dvda-author/files/digest-dvda-author-20050703 |
287 |
|
288 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/dvda-author/files/digest-dvda-author-20050703?rev=1.1&view=markup |
289 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/dvda-author/files/digest-dvda-author-20050703?rev=1.1&content-type=text/plain |
290 |
|
291 |
Index: digest-dvda-author-20050703 |
292 |
=================================================================== |
293 |
MD5 b0b212318469ee360df559ac84a0b39f dvda-author-20050703-Linux.tar.gz 270036 |
294 |
RMD160 4278d5e49af6ad71c1cc3d22c5c6371e38e282b1 dvda-author-20050703-Linux.tar.gz 270036 |
295 |
SHA256 db23f046686c6120d423ba195ec31f5e31e4b730b0efff56b07148008120fa21 dvda-author-20050703-Linux.tar.gz 270036 |
296 |
|
297 |
|
298 |
|
299 |
-- |
300 |
gentoo-commits@g.o mailing list |