[datatype-dev] Re: [Android-port-dev] CR: Fix for writing a file to an Android file descriptor

[datatype-dev] Re: [Android-port-dev] CR: Fix for writing a file to an Android file descriptor

Christina Bailey cbailey at real.com
Thu Jun 11 11:54:32 PDT 2009


I'm checking this in at 1pm today.

thanks,
christina

Christina Bailey wrote:
> Synopsis: Fix for writing a file using an Android supplied file 
> descriptor, i.e., writing to 
> "fd://fileinput?FileDescriptor=11&Offset=0&Length=0"
>
> Overview: Some of the Android interfaces use a file descriptor instead 
> of passing in the file name, so we have to use that file descriptor 
> for writing or reading. A function in the file writer lib was assuming 
> that no protocol was specified in the file path, so the protocol was 
> specified twice, "fd://fd://", which is not cool. I also added a check 
> for protocol to avoid going through unnecessary recursive directory 
> creation.
>
> Branch: HEAD only. I'm not going to check this into Atlas310 because 
> we don't have any code that does file writing, capture/encode is HEAD 
> only.
>
> Files:
> datatype/common/filewriter/archivr2.cpp
>
> Diff:
> Index: archivr2.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/common/filewriter/archivr2.cpp,v
> retrieving revision 1.17
> diff -w -u -5 -r1.17 archivr2.cpp
> --- archivr2.cpp        11 Jan 2007 20:13:55 -0000      1.17
> +++ archivr2.cpp        9 Jun 2009 23:53:57 -0000
> @@ -738,13 +738,23 @@
>            if (m_bUseNuggetFormat)
>            {
>                ComputeMinLocalDuration();
>            }
>            ProcessStreamHeaders();
> +
> +           if (!strcmp((const char*)m_ProtocolName, "fd"))
> +           {
> +               // We do not need to create directories, so go 
> straight to creating the object
> +               m_DirStatus = DIR_DONE;
> +               CreateFileObjects();
> +           }
> +           else
> +           {
>            CreateDirObjects();
>        }
>     }
> +    }
>
>     return hResult;
> }
>
> HX_RESULT
> @@ -1914,11 +1924,11 @@
>        {
>                URLFromPOSIXPath(szFilePath, strUrl);
>        }
>        else
> #endif
> -       if (szProtocol && *szProtocol != '\0')
> +       if (szProtocol && *szProtocol != '\0' && strstr(szFilePath, 
> "://") < 0)
>        {
>            strUrl.Format("%s://%s", (const char*) szProtocol, (const 
> char*) szFilePath);
>        }
>        else
>        {
>
> _______________________________________________
> Android-port-dev mailing list
> Android-port-dev at lists.helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/android-port-dev
>



More information about the Datatype-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.