[mp4v2] r507 committed - Fix for r506 commit....

23 views
Skip to first unread message

mp...@googlecode.com

unread,
Jan 5, 2015, 5:06:03 PM1/5/15
to mp...@googlegroups.com
Revision: 507
Author: Nicholas...@gmail.com
Date: Mon Jan 5 22:05:43 2015 UTC
Log: Fix for r506 commit.

This bug only affects the Windows build. The patch from revision 506
(addition of file size to file provider API) does not work with absolute
path names. The standard file provider normalizes its UTF-8 path name.
Prior to the r506 patch the platform file class called
FileSystem::getFileSize with the argument from the caller. After the r506
patch the platform class calls the file provider to get the file size. The
standard file provider uses its normalized path name as an argument to
FileSystem::getFileSize. This was a problem if the path was absolute
because the normalization added a UNC prefix, which getFileSize does not
like. The standard file provider now passes the original path value that
was supplied by the caller.

https://code.google.com/p/mp4v2/source/detail?r=507

Modified:
/trunk/libplatform/io/File_win32.cpp

=======================================
--- /trunk/libplatform/io/File_win32.cpp Fri Oct 17 22:03:13 2014 UTC
+++ /trunk/libplatform/io/File_win32.cpp Mon Jan 5 22:05:43 2015 UTC
@@ -46,6 +46,11 @@
* The UTF-8 encoded file name
*/
std::string _name;
+
+ /**
+ * Argument for FileSystem::getFileSize()
+ */
+ std::string _orig_name;
};


///////////////////////////////////////////////////////////////////////////////
@@ -67,6 +72,8 @@
bool
StandardFileProvider::open( std::string name, Mode mode )
{
+ _orig_name = name;
+
DWORD access = 0;
DWORD share = 0;
DWORD crdisp = 0;
@@ -261,7 +268,8 @@
BOOL retval;

// getFileSize will log if it fails
- retval = FileSystem::getFileSize( _name, nout );
+ // (cannot use _name because it may have UNC prefix)
+ retval = FileSystem::getFileSize( _orig_name, nout );

return retval;
}
Reply all
Reply to author
Forward
0 new messages