kdesupport/taglib/taglib/asf

Lukáš Lalinský lalinsky at gmail.com
Fri Jan 28 16:34:40 CET 2011


Hi Nick,

Please revert this change, it corrupts files on save. We need to
pass-through all the objects that were originally in the file. If you
really want to have a reading mode like this, the save() method MUST
be disabled.

Lukas

On Fri, Jan 28, 2011 at 4:14 PM, Nick Shaforostoff <shafff at ukr.net> wrote:
> SVN commit 1217775 by shaforo:
>
> disable creation of unknown objects for wma files, because we've seen the cases when it could be as large as whole file, and we are greedy for the ram
> CCMAIL:lalinsky at gmail.com
>
>
>  M  +7 -1      asffile.cpp
>
>
> --- trunk/kdesupport/taglib/taglib/asf/asffile.cpp #1217774:1217775
> @@ -320,18 +320,23 @@
>   while(dataPos < dataSize) {
>     ByteVector guid = file->readBlock(16);
>     long long size = file->readQWORD();
> -    BaseObject *obj;
> +    BaseObject *obj = 0;
>     if(guid == metadataGuid) {
>       obj = new MetadataObject();
>     }
>     else if(guid == metadataLibraryGuid) {
>       obj = new MetadataLibraryObject();
>     }
> +//FIXME this UnknownObject can be as large as whole file, so i disable it for now --Nick Shaforostoff <shafff at ukr.net>
> +/*
>     else {
>       obj = new UnknownObject(guid);
>     }
> +*/
> +    if(obj) {
>     obj->parse(file, size);
>     objects.append(obj);
> +    }
>     dataPos += size;
>   }
>  }
> @@ -360,6 +365,7 @@
>  ASF::File::~File()
>  {
>   for(unsigned int i = 0; i < d->objects.size(); i++) {
> +    d->objects[i]->data.clear();
>     delete d->objects[i];
>   }
>   if(d->tag) {
>


More information about the taglib-devel mailing list