~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavformat/sierravmd.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:
29
29
 
30
30
#include "libavutil/intreadwrite.h"
31
31
#include "avformat.h"
 
32
#include "internal.h"
32
33
 
33
34
#define VMD_HEADER_SIZE 0x0330
34
35
#define BYTES_PER_FRAME_RECORD 16
104
105
    else
105
106
        vmd->is_indeo3 = 0;
106
107
    /* start up the decoders */
107
 
    vst = av_new_stream(s, 0);
 
108
    vst = avformat_new_stream(s, NULL);
108
109
    if (!vst)
109
110
        return AVERROR(ENOMEM);
110
 
    av_set_pts_info(vst, 33, 1, 10);
 
111
    avpriv_set_pts_info(vst, 33, 1, 10);
111
112
    vmd->video_stream_index = vst->index;
112
113
    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
113
114
    vst->codec->codec_id = vmd->is_indeo3 ? CODEC_ID_INDEO3 : CODEC_ID_VMDVIDEO;
125
126
    /* if sample rate is 0, assume no audio */
126
127
    vmd->sample_rate = AV_RL16(&vmd->vmd_header[804]);
127
128
    if (vmd->sample_rate) {
128
 
        st = av_new_stream(s, 0);
 
129
        st = avformat_new_stream(s, NULL);
129
130
        if (!st)
130
131
            return AVERROR(ENOMEM);
131
132
        vmd->audio_stream_index = st->index;
148
149
        num = st->codec->block_align;
149
150
        den = st->codec->sample_rate * st->codec->channels;
150
151
        av_reduce(&den, &num, den, num, (1UL<<31)-1);
151
 
        av_set_pts_info(vst, 33, num, den);
152
 
        av_set_pts_info(st, 33, num, den);
 
152
        avpriv_set_pts_info(vst, 33, num, den);
 
153
        avpriv_set_pts_info(st, 33, num, den);
153
154
    }
154
155
 
155
156
    toc_offset = AV_RL32(&vmd->vmd_header[812]);
205
206
                vmd->frame_table[total_frames].pts = current_audio_pts;
206
207
                total_frames++;
207
208
                if(!current_audio_pts)
208
 
                    current_audio_pts += sound_buffers;
 
209
                    current_audio_pts += sound_buffers - 1;
209
210
                else
210
211
                    current_audio_pts++;
211
212
                break;
281
282
}
282
283
 
283
284
AVInputFormat ff_vmd_demuxer = {
284
 
    "vmd",
285
 
    NULL_IF_CONFIG_SMALL("Sierra VMD format"),
286
 
    sizeof(VmdDemuxContext),
287
 
    vmd_probe,
288
 
    vmd_read_header,
289
 
    vmd_read_packet,
290
 
    vmd_read_close,
 
285
    .name           = "vmd",
 
286
    .long_name      = NULL_IF_CONFIG_SMALL("Sierra VMD format"),
 
287
    .priv_data_size = sizeof(VmdDemuxContext),
 
288
    .read_probe     = vmd_probe,
 
289
    .read_header    = vmd_read_header,
 
290
    .read_packet    = vmd_read_packet,
 
291
    .read_close     = vmd_read_close,
291
292
};