Revision 77336a5e

View differences:

libavcodec/libvorbis.c
26 26

  
27 27
#include <vorbis/vorbisenc.h>
28 28

  
29
#include "libavutil/opt.h"
29 30
#include "avcodec.h"
30 31
#include "bytestream.h"
31 32
#include "vorbis.h"
......
38 39
#define BUFFER_SIZE (1024*64)
39 40

  
40 41
typedef struct OggVorbisContext {
42
    AVClass *av_class;
41 43
    vorbis_info vi ;
42 44
    vorbis_dsp_state vd ;
43 45
    vorbis_block vb ;
......
48 50
    /* decoder */
49 51
    vorbis_comment vc ;
50 52
    ogg_packet op;
53

  
54
    double iblock;
51 55
} OggVorbisContext ;
52 56

  
57
static const AVOption options[]={
58
{"iblock", "Sets the impulse block bias", offsetof(OggVorbisContext, iblock), FF_OPT_TYPE_DOUBLE, 0, -15, 0, AV_OPT_FLAG_ENCODING_PARAM},
59
{NULL}
60
};
61
static const AVClass class = { "libvorbis", NULL, options, LIBAVUTIL_VERSION_INT };
53 62

  
54 63
static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) {
64
    OggVorbisContext *context = avccontext->priv_data ;
55 65
    double cfreq;
56 66

  
57 67
    if(avccontext->flags & CODEC_FLAG_QSCALE) {
......
82 92
            return -1;
83 93
    }
84 94

  
95
    if(context->iblock){
96
        vorbis_encode_ctl(vi, OV_ECTL_IBLOCK_SET, &context->iblock);
97
    }
98

  
85 99
    return vorbis_encode_setup_init(vi);
86 100
}
87 101

  
......
240 254
    .capabilities= CODEC_CAP_DELAY,
241 255
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
242 256
    .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
257
    .priv_class= &class,
243 258
} ;

Also available in: Unified diff