Revision c7ff04e2

View differences:

tests/seek_test.c
60 60
int main(int argc, char **argv)
61 61
{
62 62
    const char *filename;
63
    AVFormatContext *ic;
63
    AVFormatContext *ic = NULL;
64 64
    int i, ret, stream_id;
65 65
    int64_t timestamp;
66 66
    AVFormatParameters params, *ap= &params;
......
79 79

  
80 80
    filename = argv[1];
81 81

  
82
    /* allocate the media context */
83
    ic = avformat_alloc_context();
84
    if (!ic) {
85
        fprintf(stderr, "Memory error\n");
86
        exit(1);
87
    }
88

  
89 82
    ret = av_open_input_file(&ic, filename, NULL, 0, ap);
90 83
    if (ret < 0) {
91 84
        fprintf(stderr, "cannot open %s\n", filename);
......
132 125
        printf("ret:%-10s st:%2d flags:%d  ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf);
133 126
    }
134 127

  
128
    av_close_input_file(ic);
129

  
135 130
    return 0;
136 131
}

Also available in: Unified diff