~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavformat/anm.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
#include "libavutil/intreadwrite.h"
28
28
#include "avformat.h"
 
29
#include "internal.h"
29
30
 
30
31
typedef struct {
31
32
    int base_record;
97
98
        return AVERROR_INVALIDDATA;
98
99
 
99
100
    /* video stream */
100
 
    st = av_new_stream(s, 0);
 
101
    st = avformat_new_stream(s, NULL);
101
102
    if (!st)
102
103
        return AVERROR(ENOMEM);
103
104
    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
128
129
 
129
130
    avio_skip(pb, 32); /* record_types */
130
131
    st->nb_frames = avio_rl32(pb);
131
 
    av_set_pts_info(st, 64, 1, avio_rl16(pb));
 
132
    avpriv_set_pts_info(st, 64, 1, avio_rl16(pb));
132
133
    avio_skip(pb, 58);
133
134
 
134
135
    /* color cycling and palette data */
136
137
    st->codec->extradata      = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
137
138
    if (!st->codec->extradata) {
138
139
        ret = AVERROR(ENOMEM);
139
 
        goto close_and_return;
 
140
        goto fail;
140
141
    }
141
142
    ret = avio_read(pb, st->codec->extradata, st->codec->extradata_size);
142
143
    if (ret < 0)
143
 
        goto close_and_return;
 
144
        goto fail;
144
145
 
145
146
    /* read page table */
146
147
    ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
147
148
    if (ret < 0)
148
 
        goto close_and_return;
 
149
        goto fail;
149
150
 
150
151
    for (i = 0; i < MAX_PAGES; i++) {
151
152
        Page *p = &anm->pt[i];
158
159
    anm->page = find_record(anm, 0);
159
160
    if (anm->page < 0) {
160
161
        ret = anm->page;
161
 
        goto close_and_return;
 
162
        goto fail;
162
163
    }
163
164
 
164
165
    anm->record = -1;
168
169
    av_log_ask_for_sample(s, NULL);
169
170
    ret = AVERROR_INVALIDDATA;
170
171
 
171
 
close_and_return:
172
 
    av_close_input_stream(s);
 
172
fail:
173
173
    return ret;
174
174
}
175
175
 
226
226
}
227
227
 
228
228
AVInputFormat ff_anm_demuxer = {
229
 
    "anm",
230
 
    NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
231
 
    sizeof(AnmDemuxContext),
232
 
    probe,
233
 
    read_header,
234
 
    read_packet,
 
229
    .name           = "anm",
 
230
    .long_name      = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
 
231
    .priv_data_size = sizeof(AnmDemuxContext),
 
232
    .read_probe     = probe,
 
233
    .read_header    = read_header,
 
234
    .read_packet    = read_packet,
235
235
};