~ubuntu-branches/ubuntu/feisty/avidemux/feisty

« back to all changes in this revision

Viewing changes to adm_lavcodec/parser.c

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2005-05-25 13:02:29 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050525130229-jw94cav0yhmg7vjw
Tags: 1:2.0.40-0.0
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    for(parser = av_first_parser; parser != NULL; parser = parser->next) {
39
39
        if (parser->codec_ids[0] == codec_id ||
40
40
            parser->codec_ids[1] == codec_id ||
41
 
            parser->codec_ids[2] == codec_id)
 
41
            parser->codec_ids[2] == codec_id ||
 
42
            parser->codec_ids[3] == codec_id ||
 
43
            parser->codec_ids[4] == codec_id)
42
44
            goto found;
43
45
    }
44
46
    return NULL;
185
187
    for(; pc->overread>0; pc->overread--){
186
188
        pc->buffer[pc->index++]= pc->buffer[pc->overread_index++];
187
189
    }
188
 
    
 
190
 
 
191
    /* flush remaining if EOF */
 
192
    if(!*buf_size && next == END_NOT_FOUND){
 
193
        next= 0;
 
194
    }
 
195
 
189
196
    pc->last_index= pc->index;
190
197
 
191
198
    /* copy into buffer end return */
297
304
            break;
298
305
        case SEQ_START_CODE:
299
306
            if (bytes_left >= 4) {
300
 
                pc->width = avctx->width = (buf[0] << 4) | (buf[1] >> 4);
301
 
                pc->height = avctx->height = ((buf[1] & 0x0f) << 8) | buf[2];
 
307
                pc->width  = (buf[0] << 4) | (buf[1] >> 4);
 
308
                pc->height = ((buf[1] & 0x0f) << 8) | buf[2];
 
309
                avcodec_set_dimensions(avctx, pc->width, pc->height);
302
310
                frame_rate_index = buf[3] & 0xf;
303
311
                pc->frame_rate = avctx->frame_rate = frame_rate_tab[frame_rate_index];
304
312
                avctx->frame_rate_base = MPEG1_FRAME_RATE_BASE;
317
325
                        frame_rate_ext_n = (buf[5] >> 5) & 3;
318
326
                        frame_rate_ext_d = (buf[5] & 0x1f);
319
327
                        pc->progressive_sequence = buf[1] & (1 << 3);
 
328
                        avctx->has_b_frames= buf[5] >> 7;
320
329
 
321
 
                        avctx->width = pc->width | (horiz_size_ext << 12);
322
 
                        avctx->height = pc->height | (vert_size_ext << 12);
 
330
                        pc->width  |=(horiz_size_ext << 12);
 
331
                        pc->height |=( vert_size_ext << 12);
 
332
                        avcodec_set_dimensions(avctx, pc->width, pc->height);
323
333
                        avctx->frame_rate = pc->frame_rate * (frame_rate_ext_n + 1);
324
334
                        avctx->frame_rate_base = MPEG1_FRAME_RATE_BASE * (frame_rate_ext_d + 1);
325
335
                        avctx->codec_id = CODEC_ID_MPEG2VIDEO;
437
447
    init_get_bits(gb, buf, 8 * buf_size);
438
448
    ret = ff_mpeg4_decode_picture_header(s, gb);
439
449
    if (s->width) {
440
 
        avctx->width = s->width;
441
 
        avctx->height = s->height;
 
450
        avcodec_set_dimensions(avctx, s->width, s->height);
442
451
    }
443
452
    pc->first_picture = 0;
444
453
    return ret;