mirror of https://git.ffmpeg.org/ffmpeg.git
libgsm: Fix compilation.
Move libgsm_encode_close before its first use and call it with the correct number of arguments. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
parent
f122cbf087
commit
dbc7c6121e
|
@ -32,6 +32,13 @@
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "gsm.h"
|
#include "gsm.h"
|
||||||
|
|
||||||
|
static av_cold int libgsm_encode_close(AVCodecContext *avctx) {
|
||||||
|
av_freep(&avctx->coded_frame);
|
||||||
|
gsm_destroy(avctx->priv_data);
|
||||||
|
avctx->priv_data = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
|
static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
|
||||||
if (avctx->channels > 1) {
|
if (avctx->channels > 1) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
|
av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
|
||||||
|
@ -77,17 +84,10 @@ static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
libgsm_encode_close();
|
libgsm_encode_close(avctx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int libgsm_encode_close(AVCodecContext *avctx) {
|
|
||||||
av_freep(&avctx->coded_frame);
|
|
||||||
gsm_destroy(avctx->priv_data);
|
|
||||||
avctx->priv_data = NULL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int libgsm_encode_frame(AVCodecContext *avctx,
|
static int libgsm_encode_frame(AVCodecContext *avctx,
|
||||||
unsigned char *frame, int buf_size, void *data) {
|
unsigned char *frame, int buf_size, void *data) {
|
||||||
// we need a full block
|
// we need a full block
|
||||||
|
|
Loading…
Reference in New Issue