~ubuntu-branches/debian/sid/gstreamer0.10-ffmpeg/sid

« back to all changes in this revision

Viewing changes to gst-libs/ext/ffmpeg/output_example.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-02-22 12:24:07 UTC
  • mfrom: (1.1.24 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090222122407-nubojphrd84klmee
Tags: 0.10.6-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#define M_PI 3.14159265358979323846
32
32
#endif
33
33
 
34
 
#include "avformat.h"
35
 
#include "swscale.h"
 
34
#include "libavformat/avformat.h"
 
35
#include "libswscale/swscale.h"
36
36
 
37
37
#undef exit
38
38
 
156
156
 
157
157
    pkt.size= avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);
158
158
 
159
 
    pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
 
159
    if (c->coded_frame->pts != AV_NOPTS_VALUE)
 
160
        pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
160
161
    pkt.flags |= PKT_FLAG_KEY;
161
162
    pkt.stream_index= st->index;
162
163
    pkt.data= audio_outbuf;
380
381
            AVPacket pkt;
381
382
            av_init_packet(&pkt);
382
383
 
383
 
            pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
 
384
            if (c->coded_frame->pts != AV_NOPTS_VALUE)
 
385
                pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
384
386
            if(c->coded_frame->key_frame)
385
387
                pkt.flags |= PKT_FLAG_KEY;
386
388
            pkt.stream_index= st->index;