~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/tests/seek_test.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2008-12-26 00:10:06 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20081226001006-wd8cuqn8d81smkdp
Tags: upstream-1.1.7
ImportĀ upstreamĀ versionĀ 1.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "avformat.h"
25
25
 
 
26
#undef exit
 
27
 
26
28
int main(int argc, char **argv)
27
29
{
28
30
    const char *filename;
29
31
    AVFormatContext *ic;
30
32
    int i, ret, stream_id;
31
33
    int64_t timestamp;
 
34
    AVFormatParameters params, *ap= &params;
 
35
    memset(ap, 0, sizeof(params));
 
36
    ap->channels=1;
 
37
    ap->sample_rate= 22050;
32
38
 
33
39
    /* initialize libavcodec, and register all codecs and formats */
34
40
    av_register_all();
48
54
        exit(1);
49
55
    }
50
56
 
51
 
    ret = av_open_input_file(&ic, filename, NULL, 0, NULL);
 
57
    ret = av_open_input_file(&ic, filename, NULL, 0, ap);
52
58
    if (ret < 0) {
53
 
        fprintf(stderr, "cant open %s\n", filename);
 
59
        fprintf(stderr, "cannot open %s\n", filename);
54
60
        exit(1);
55
61
    }
56
62
 
70
76
            printf("ret:%2d", ret);
71
77
            if(ret>=0){
72
78
                st= ic->streams[pkt.stream_index];
73
 
                printf(" st:%2d dts:%f pts:%f pos:%Ld size:%d flags:%d", pkt.stream_index, pkt.dts*av_q2d(st->time_base), pkt.pts*av_q2d(st->time_base), pkt.pos, pkt.size, pkt.flags);
 
79
                printf(" st:%2d dts:%f pts:%f pos:%" PRId64 " size:%d flags:%d", pkt.stream_index, pkt.dts*av_q2d(st->time_base), pkt.pts*av_q2d(st->time_base), pkt.pos, pkt.size, pkt.flags);
74
80
            }
75
81
            printf("\n");
76
82
        }