mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-11 03:32:39 +00:00
libvorbis: K&R reformatting cosmetics
This commit is contained in:
parent
c4db344664
commit
ca5ab8cd21
@ -61,7 +61,8 @@ static const AVOption options[]={
|
|||||||
};
|
};
|
||||||
static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
|
static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
|
||||||
|
|
||||||
static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) {
|
static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext)
|
||||||
|
{
|
||||||
OggVorbisContext *context = avccontext->priv_data;
|
OggVorbisContext *context = avccontext->priv_data;
|
||||||
double cfreq;
|
double cfreq;
|
||||||
|
|
||||||
@ -77,7 +78,8 @@ static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avcco
|
|||||||
|
|
||||||
/* constant bitrate */
|
/* constant bitrate */
|
||||||
if (vorbis_encode_setup_managed(vi, avccontext->channels,
|
if (vorbis_encode_setup_managed(vi, avccontext->channels,
|
||||||
avccontext->sample_rate, minrate, avccontext->bit_rate, maxrate))
|
avccontext->sample_rate, minrate,
|
||||||
|
avccontext->bit_rate, maxrate))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* variable bitrate by estimate, disable slow rate management */
|
/* variable bitrate by estimate, disable slow rate management */
|
||||||
@ -101,9 +103,13 @@ static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avcco
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* How many bytes are needed for a buffer of length 'l' */
|
/* How many bytes are needed for a buffer of length 'l' */
|
||||||
static int xiph_len(int l) { return (1 + l / 255 + l); }
|
static int xiph_len(int l)
|
||||||
|
{
|
||||||
|
return (1 + l / 255 + l);
|
||||||
|
}
|
||||||
|
|
||||||
static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext) {
|
static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext)
|
||||||
|
{
|
||||||
OggVorbisContext *context = avccontext->priv_data;
|
OggVorbisContext *context = avccontext->priv_data;
|
||||||
ogg_packet header, header_comm, header_code;
|
ogg_packet header, header_comm, header_code;
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
@ -140,9 +146,11 @@ static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext) {
|
|||||||
offset += header_code.bytes;
|
offset += header_code.bytes;
|
||||||
assert(offset == avccontext->extradata_size);
|
assert(offset == avccontext->extradata_size);
|
||||||
|
|
||||||
/* vorbis_block_clear(&context->vb);
|
#if 0
|
||||||
|
vorbis_block_clear(&context->vb);
|
||||||
vorbis_dsp_clear(&context->vd);
|
vorbis_dsp_clear(&context->vd);
|
||||||
vorbis_info_clear(&context->vi);*/
|
vorbis_info_clear(&context->vi);
|
||||||
|
#endif
|
||||||
vorbis_comment_clear(&context->vc);
|
vorbis_comment_clear(&context->vc);
|
||||||
|
|
||||||
avccontext->frame_size = OGGVORBIS_FRAME_SIZE;
|
avccontext->frame_size = OGGVORBIS_FRAME_SIZE;
|
||||||
@ -153,7 +161,6 @@ static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int oggvorbis_encode_frame(AVCodecContext *avccontext,
|
static int oggvorbis_encode_frame(AVCodecContext *avccontext,
|
||||||
unsigned char *packets,
|
unsigned char *packets,
|
||||||
int buf_size, void *data)
|
int buf_size, void *data)
|
||||||
@ -226,8 +233,8 @@ static int oggvorbis_encode_frame(AVCodecContext *avccontext,
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static av_cold int oggvorbis_encode_close(AVCodecContext *avccontext)
|
||||||
static av_cold int oggvorbis_encode_close(AVCodecContext *avccontext) {
|
{
|
||||||
OggVorbisContext *context = avccontext->priv_data;
|
OggVorbisContext *context = avccontext->priv_data;
|
||||||
/* ogg_packet op ; */
|
/* ogg_packet op ; */
|
||||||
|
|
||||||
@ -243,7 +250,6 @@ static av_cold int oggvorbis_encode_close(AVCodecContext *avccontext) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AVCodec ff_libvorbis_encoder = {
|
AVCodec ff_libvorbis_encoder = {
|
||||||
.name = "libvorbis",
|
.name = "libvorbis",
|
||||||
.type = AVMEDIA_TYPE_AUDIO,
|
.type = AVMEDIA_TYPE_AUDIO,
|
||||||
|
Loading…
Reference in New Issue
Block a user