~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavformat/mxg.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:
22
22
#include "libavutil/intreadwrite.h"
23
23
#include "libavcodec/mjpeg.h"
24
24
#include "avformat.h"
 
25
#include "internal.h"
25
26
#include "avio.h"
26
27
 
27
 
#define VIDEO_STREAM_INDEX 0
28
 
#define AUDIO_STREAM_INDEX 1
29
28
#define DEFAULT_PACKET_SIZE 1024
30
29
#define OVERREAD_SIZE 3
31
30
 
44
43
    MXGContext *mxg = s->priv_data;
45
44
 
46
45
    /* video parameters will be extracted from the compressed bitstream */
47
 
    video_st = av_new_stream(s, VIDEO_STREAM_INDEX);
 
46
    video_st = avformat_new_stream(s, NULL);
48
47
    if (!video_st)
49
48
        return AVERROR(ENOMEM);
50
49
    video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
51
50
    video_st->codec->codec_id = CODEC_ID_MXPEG;
52
 
    av_set_pts_info(video_st, 64, 1, 1000000);
 
51
    avpriv_set_pts_info(video_st, 64, 1, 1000000);
53
52
 
54
 
    audio_st = av_new_stream(s, AUDIO_STREAM_INDEX);
 
53
    audio_st = avformat_new_stream(s, NULL);
55
54
    if (!audio_st)
56
55
        return AVERROR(ENOMEM);
57
56
    audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
60
59
    audio_st->codec->sample_rate = 8000;
61
60
    audio_st->codec->bits_per_coded_sample = 8;
62
61
    audio_st->codec->block_align = 1;
63
 
    av_set_pts_info(audio_st, 64, 1, 1000000);
 
62
    avpriv_set_pts_info(audio_st, 64, 1, 1000000);
64
63
 
65
64
    mxg->soi_ptr = mxg->buffer_ptr = mxg->buffer = 0;
66
65
    mxg->buffer_size = 0;
166
165
                }
167
166
 
168
167
                pkt->pts = pkt->dts = mxg->dts;
169
 
                pkt->stream_index = VIDEO_STREAM_INDEX;
 
168
                pkt->stream_index = 0;
170
169
                pkt->destruct = NULL;
171
170
                pkt->size = mxg->buffer_ptr - mxg->soi_ptr;
172
171
                pkt->data = mxg->soi_ptr;
204
203
                if (marker == APP13 && size >= 16) { /* audio data */
205
204
                    /* time (GMT) of first sample in usec since 1970, little-endian */
206
205
                    pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8);
207
 
                    pkt->stream_index = AUDIO_STREAM_INDEX;
 
206
                    pkt->stream_index = 1;
208
207
                    pkt->destruct = NULL;
209
208
                    pkt->size = size - 14;
210
209
                    pkt->data = startmarker_ptr + 16;