Revision d9d9a8c0 libavformat/electronicarts.c

View differences:

libavformat/electronicarts.c
41 41
#define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
42 42
#define kVGT_TAG MKTAG('k', 'V', 'G', 'T')    /* TGV i-frame */
43 43
#define fVGT_TAG MKTAG('f', 'V', 'G', 'T')    /* TGV p-frame */
44
#define mTCD_TAG MKTAG('m', 'T', 'C', 'D')    /* MDEC */
44 45
#define MADk_TAG MKTAG('M', 'A', 'D', 'k')    /* MAD i-frame */
45 46
#define MPCh_TAG MKTAG('M', 'P', 'C', 'h')    /* MPEG2 */
46 47
#define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
......
54 55

  
55 56
    enum CodecID video_codec;
56 57
    AVRational time_base;
58
    int width, height;
57 59
    int video_stream_index;
58 60

  
59 61
    enum CodecID audio_codec;
......
245 247
    return 1;
246 248
}
247 249

  
250
static int process_video_header_mdec(AVFormatContext *s)
251
{
252
    EaDemuxContext *ea = s->priv_data;
253
    ByteIOContext *pb = s->pb;
254
    url_fskip(pb, 4);
255
    ea->width  = get_le16(pb);
256
    ea->height = get_le16(pb);
257
    ea->time_base = (AVRational){1,15};
258
    ea->video_codec = CODEC_ID_MDEC;
259
    return 1;
260
}
261

  
248 262
static int process_video_header_vp6(AVFormatContext *s)
249 263
{
250 264
    EaDemuxContext *ea = s->priv_data;
......
313 327
                ea->time_base = (AVRational){0,0};
314 328
                break;
315 329

  
330
            case mTCD_TAG :
331
                err = process_video_header_mdec(s);
332
                break;
333

  
316 334
            case MVhd_TAG :
317 335
                err = process_video_header_vp6(s);
318 336
                break;
......
367 385
        st->codec->codec_id = ea->video_codec;
368 386
        st->codec->codec_tag = 0;  /* no fourcc */
369 387
        st->codec->time_base = ea->time_base;
388
        st->codec->width = ea->width;
389
        st->codec->height = ea->height;
370 390
    }
371 391

  
372 392
    if (ea->audio_codec) {
......
464 484
            chunk_size += 8;
465 485
            goto get_video_packet;
466 486

  
487
        case mTCD_TAG:
488
            url_fseek(pb, 8, SEEK_CUR);  // skip ea dct header
489
            chunk_size -= 8;
490
            goto get_video_packet;
491

  
467 492
        case MV0K_TAG:
468 493
            key = PKT_FLAG_KEY;
469 494
        case MV0F_TAG:

Also available in: Unified diff