~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/libmpg123/index.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2009-12-21 00:11:29 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20091221001129-gsbnzbenceqv4pjt
Tags: upstream-1.10.0
ImportĀ upstreamĀ versionĀ 1.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        }
106
106
}
107
107
 
 
108
int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill)
 
109
{
 
110
        if(fi_resize(fi, fill) == -1) return -1;
 
111
        fi->step = step;
 
112
        if(offsets != NULL)
 
113
        {
 
114
                memcpy(fi->data, offsets, fill*sizeof(off_t));
 
115
                fi->fill = fill;
 
116
        }
 
117
        else
 
118
        {
 
119
                /* allocation only, no entries in index yet */
 
120
                fi->fill = 0;
 
121
        }
 
122
        fi->next = fi_next(fi);
 
123
        debug3("set new index of fill %lu, size %lu at %p",
 
124
        (unsigned long)fi->fill, (unsigned long)fi->size, (void*)fi->data);
 
125
        return 0;
 
126
}
 
127
 
108
128
void fi_reset(struct frame_index *fi)
109
129
{
110
130
        debug1("reset with size %"SIZE_P, (size_p)fi->size);