~ubuntu-branches/ubuntu/precise/libav/precise-updates

« back to all changes in this revision

Viewing changes to libavformat/electronicarts.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:30:00 UTC
  • mfrom: (1.2.8) (1.1.13 experimental)
  • Revision ID: package-import@ubuntu.com-20120112223000-cmfo7w78q13i2fd9
Tags: 4:0.8~beta2-1ubuntu1
* Merge from debian, remaining changes:
  - don't build against libdirac, lame, libopenjpeg, librtmp, 
    x264, and xvid  (all in universe)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "libavutil/intreadwrite.h"
29
29
#include "avformat.h"
 
30
#include "internal.h"
30
31
 
31
32
#define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
32
33
#define SEAD_TAG MKTAG('S', 'E', 'A', 'D')    /* Sxxx header */
410
411
 
411
412
    if (ea->video_codec) {
412
413
        /* initialize the video decoder stream */
413
 
        st = av_new_stream(s, 0);
 
414
        st = avformat_new_stream(s, NULL);
414
415
        if (!st)
415
416
            return AVERROR(ENOMEM);
416
417
        ea->video_stream_index = st->index;
433
434
            ea->audio_codec = 0;
434
435
            return 1;
435
436
        }
 
437
        if (ea->bytes <= 0) {
 
438
            av_log(s, AV_LOG_ERROR, "Invalid number of bytes per sample: %d\n", ea->bytes);
 
439
            ea->audio_codec = CODEC_ID_NONE;
 
440
            return 1;
 
441
        }
436
442
 
437
443
        /* initialize the audio decoder stream */
438
 
        st = av_new_stream(s, 0);
 
444
        st = avformat_new_stream(s, NULL);
439
445
        if (!st)
440
446
            return AVERROR(ENOMEM);
441
 
        av_set_pts_info(st, 33, 1, ea->sample_rate);
 
447
        avpriv_set_pts_info(st, 33, 1, ea->sample_rate);
442
448
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
443
449
        st->codec->codec_id = ea->audio_codec;
444
450
        st->codec->codec_tag = 0;  /* no tag */
569
575
}
570
576
 
571
577
AVInputFormat ff_ea_demuxer = {
572
 
    "ea",
573
 
    NULL_IF_CONFIG_SMALL("Electronic Arts Multimedia Format"),
574
 
    sizeof(EaDemuxContext),
575
 
    ea_probe,
576
 
    ea_read_header,
577
 
    ea_read_packet,
 
578
    .name           = "ea",
 
579
    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts Multimedia Format"),
 
580
    .priv_data_size = sizeof(EaDemuxContext),
 
581
    .read_probe     = ea_probe,
 
582
    .read_header    = ea_read_header,
 
583
    .read_packet    = ea_read_packet,
578
584
};