Displaying 11 results from an estimated 11 matches for "file_type_disk".
2015 Dec 10
5
Windows file buffering
...git.xiph.org/?p=flac.git;a=commitdiff;h=d66f6754bf94bc8ba23d3579d0b5650cd380c9f0> ?
Because setvbuf() should definitely change libFLAC behaviour regardless of files/pipes/etc.
The attached patch *should* resolve the issue. libFLAC will call setvbuf(file, ...)
only if GetFileType(...file...) == FILE_TYPE_DISK.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buffering.patch
Type: application/octet-stream
Size: 615 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20151210/c3bffdd5/attachment.obj
2016 Feb 09
2
Compilation failure using mingw-w64 and gcc-5.3.0
...^
decode.c:271:14: error: 'INVALID_HANDLE_VALUE' undeclared (first use in
this function)
if(fh != INVALID_HANDLE_VALUE) {
^
decode.c:272:9: warning: implicit declaration of function 'GetFileType'
[-Wimplicit-function-declaration]
if(GetFileType(fh) == FILE_TYPE_DISK) {
^
decode.c:272:6: warning: nested extern declaration of 'GetFileType'
[-Wnested-externs]
if(GetFileType(fh) == FILE_TYPE_DISK) {
^
decode.c:272:28: error: 'FILE_TYPE_DISK' undeclared (first use in this
function)
if(GetFileType(fh) == FILE_TYPE_DISK) {...
2016 Feb 08
2
Compilation failure using mingw-w64 and gcc-5.3.0
Hello,
Upon compiling the flac tree today, after many successful compilations over
the last few weeks, a new error is appearing before compilation bails out.
This is a cross-compilation using gcc-5.3.0 running on GNU/Linux, with the
objects being built for a mingw-w64-x86_64 host.
Among other things, the compiler is looking for windows_unicode_filenames.h
but it isn't there. Also, I'm
2014 Sep 26
4
Patch to add buffering to decoding too
...(strcmp(outfilename, "-") && d->total_samples > 0) {
+ HANDLE fh = CreateFile_utf8(outfilename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if(fh != INVALID_HANDLE_VALUE) {
+ if (GetFileType(fh) == FILE_TYPE_DISK) {
+ LARGE_INTEGER size;
+ size.QuadPart = d->total_samples * d->channels * ((d->bps+7)/8) + 512;
+ if(d->foreign_metadata) {
+ size_t i;
+ for(i = d->format==FORMAT_RF64?2:1; i < d->foreign_metadata->num_blocks; i++) {
+ if(i != d->foreign_met...
2014 Sep 27
0
Patch to add buffering to decoding too
...f_t written_size = ftello(d->fout);
+ if(written_size > 0) {
+ HANDLE fh = CreateFile_utf8(d->outfilename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if(fh != INVALID_HANDLE_VALUE) {
+ if(GetFileType(fh) == FILE_TYPE_DISK) {
+ LARGE_INTEGER size;
+ size.QuadPart = written_size;
+ if(SetFilePointerEx(fh, size, NULL, FILE_CURRENT)) /* correct the file size */
+ SetEndOfFile(fh);
+ }
+ CloseHandle(fh);
+ }
+ }
+ }
+#endif
fclose(d->fout);
if(error_occurred)
flac_unlink(d...
2015 Dec 10
0
Windows file buffering
...66f6754bf94bc8ba23d3579d0b5650cd380c9f0>
> ?
> Because setvbuf() should definitely change libFLAC behaviour
> regardless of files/pipes/etc.
>
>
> The attached patch *should* resolve the issue. libFLAC will call
> setvbuf(file, ...)
> only if GetFileType(...file...) == FILE_TYPE_DISK.
I probably don't know enough about the intricates of Win32, but why not
prefer this for clarity:
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index 203a271..0394c26 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -1330,7 +1330,8 @@...
2015 Dec 10
0
Windows file buffering
...ther commit? For example,
> <http://git.xiph.org/?p=flac.git;a=commitdiff;h=d66f6754bf94bc8ba23d3579d0b5650cd380c9f0> ?
Yes, that is exactly what i meant.
>
> The attached patch *should* resolve the issue. libFLAC will call setvbuf(file, ...)
> only if GetFileType(...file...) == FILE_TYPE_DISK.
That patch looks correct. That said, i'm not sure why there's setvbuf() in
the first place. I mean, the code to de-fragment the output file already
exists (the aforementioned d66f675), so why buffering? Was it proven
empirically that buffering is required? Or am i looking at this backward...
2015 Dec 10
2
Windows file buffering
lvqcl,
Would you be able to have alook at this one? I think its
Windows related:
https://sourceforge.net/p/flac/feature-requests/114/
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
2014 Sep 26
0
Patch to add buffering to decoding too
...(strcmp(outfilename, "-") && d->total_samples > 0) {
+ HANDLE fh = CreateFile_utf8(outfilename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if(fh != INVALID_HANDLE_VALUE) {
+ if (GetFileType(fh) == FILE_TYPE_DISK) {
+ LARGE_INTEGER size, pos;
+
+ size.QuadPart = d->total_samples * d->channels * ((d->bps+7)/8) + 512;
+ if(d->foreign_metadata) {
+ size_t i;
+ for(i = d->format==FORMAT_RF64?2:1; i < d->foreign_metadata->num_blocks; i++) {
+ if(i != d->fore...
2014 Sep 26
3
Patch to add buffering to decoding too
Can you please wrap the setvbuf in _WIN32 IFDEFs too? Currently
memory usage of FLAC decoding is about 1MB, so this patch is
increasing memory usage tenfold, also for platforms that do not
need this. It is a non-problem on my system anyway.
Op 26-09-14 om 10:36 schreef Janne Hyv?rinen:
> I made some changes to the previous patch. I don't know why I
> originally didn't put the
2014 Sep 25
2
Patch to add buffering to decoding too
Decoding flac files is also prone to producing fragmented files. NTFS
has the ability to completely avoid fragmentation if it is told the file
size before hand, but that would require using special Windows-only
functions. Increasing the write buffer from the default 512 bytes to 10
MB already reduces the problem tremendously.
-------------- next part --------------
diff --git