Revision ffdc49df libavformat/avidec.c

View differences:

libavformat/avidec.c
25 25
#include <strings.h>
26 26
#include "libavutil/intreadwrite.h"
27 27
#include "libavutil/bswap.h"
28
#include "libavutil/opt.h"
28 29
#include "avformat.h"
29 30
#include "avi.h"
30 31
#include "dv.h"
......
59 60
} AVIStream;
60 61

  
61 62
typedef struct {
63
    const AVClass *class;
62 64
    int64_t  riff_end;
63 65
    int64_t  movi_end;
64 66
    int64_t  fsize;
......
70 72
    int stream_index;
71 73
    DVDemuxContext* dv_demux;
72 74
    int odml_depth;
75
    int use_odml;
73 76
#define MAX_ODML_DEPTH 1000
74 77
} AVIContext;
75 78

  
79

  
80
static const AVOption options[] = {
81
    { "use_odml", "use odml index", offsetof(AVIContext, use_odml), FF_OPT_TYPE_INT, 1, -1, 1, AV_OPT_FLAG_DECODING_PARAM},
82
    { NULL },
83
};
84

  
85
static const AVClass demuxer_class = {
86
    "AVI demuxer",
87
    av_default_item_name,
88
    options,
89
    LIBAVUTIL_VERSION_INT,
90
};
91

  
92

  
76 93
static const char avi_headers[][8] = {
77 94
    { 'R', 'I', 'F', 'F',    'A', 'V', 'I', ' ' },
78 95
    { 'R', 'I', 'F', 'F',    'A', 'V', 'I', 'X' },
......
354 371
    if (get_riff(s, pb) < 0)
355 372
        return -1;
356 373

  
374
    av_log(avi, AV_LOG_DEBUG, "use odml:%d\n", avi->use_odml);
375

  
357 376
    avi->fsize = avio_size(pb);
358 377
    if(avi->fsize<=0)
359 378
        avi->fsize= avi->riff_end == 8 ? INT64_MAX : avi->riff_end;
......
673 692
            break;
674 693
        case MKTAG('i', 'n', 'd', 'x'):
675 694
            i= avio_tell(pb);
676
            if(pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX)){
695
            if(pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) && avi->use_odml){
677 696
                read_braindead_odml_indx(s, 0);
678 697
            }
679 698
            avio_seek(pb, i+size, SEEK_SET);
......
1385 1404
    avi_read_packet,
1386 1405
    avi_read_close,
1387 1406
    avi_read_seek,
1407
    .priv_class = &demuxer_class,
1388 1408
};

Also available in: Unified diff