Ignore:
Timestamp:
Jan 17, 2013, 6:55:51 PM (8 years ago)
Author:
jordan
Message:

(utils) #4137 'support user-defined piece sizes in transmission-create' -- done. Initial patch by lav.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/makemeta.c

    r13683 r13800  
    163163           builderFileCompare);
    164164
    165     ret->pieceSize = bestPieceSize (ret->totalSize);
    166     ret->pieceCount = (int)(ret->totalSize / ret->pieceSize);
    167     if (ret->totalSize % ret->pieceSize)
    168         ++ret->pieceCount;
     165    tr_metaInfoBuilderSetPieceSize (ret, bestPieceSize (ret->totalSize));
    169166
    170167    return ret;
    171168}
     169
     170void
     171tr_metaInfoBuilderSetPieceSize (tr_metainfo_builder * b,
     172                                uint32_t              bytes)
     173{
     174  b->pieceSize = bytes;
     175
     176  b->pieceCount = (int)(b->totalSize / b->pieceSize);
     177  if (b->totalSize % b->pieceSize)
     178    ++b->pieceCount;
     179}
     180
    172181
    173182void
Note: See TracChangeset for help on using the changeset viewer.