Commit 402c9878 authored by Justin Ruggles's avatar Justin Ruggles

libopencore-amr: remove unneeded frame_count field.

Use AVCodecContext.frame_number instead.
parent 71ccfb3f
...@@ -79,7 +79,6 @@ static int get_bitrate_mode(int bitrate, void *log_ctx) ...@@ -79,7 +79,6 @@ static int get_bitrate_mode(int bitrate, void *log_ctx)
typedef struct AMRContext { typedef struct AMRContext {
AVClass *av_class; AVClass *av_class;
int frame_count;
void *dec_state; void *dec_state;
void *enc_state; void *enc_state;
int enc_bitrate; int enc_bitrate;
...@@ -100,7 +99,6 @@ static av_cold int amr_nb_decode_init(AVCodecContext *avctx) ...@@ -100,7 +99,6 @@ static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
{ {
AMRContext *s = avctx->priv_data; AMRContext *s = avctx->priv_data;
s->frame_count = 0;
s->dec_state = Decoder_Interface_init(); s->dec_state = Decoder_Interface_init();
if (!s->dec_state) { if (!s->dec_state) {
av_log(avctx, AV_LOG_ERROR, "Decoder_Interface_init error\n"); av_log(avctx, AV_LOG_ERROR, "Decoder_Interface_init error\n");
...@@ -136,7 +134,7 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data, ...@@ -136,7 +134,7 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
int packet_size; int packet_size;
av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n", av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
buf, buf_size, s->frame_count); buf, buf_size, avctx->frame_number);
dec_mode = (buf[0] >> 3) & 0x000F; dec_mode = (buf[0] >> 3) & 0x000F;
packet_size = block_size[dec_mode] + 1; packet_size = block_size[dec_mode] + 1;
...@@ -147,7 +145,6 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data, ...@@ -147,7 +145,6 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->frame_count++;
av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n", av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
packet_size, buf[0], buf[1], buf[2], buf[3]); packet_size, buf[0], buf[1], buf[2], buf[3]);
/* call decoder */ /* call decoder */
...@@ -172,8 +169,6 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx) ...@@ -172,8 +169,6 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
{ {
AMRContext *s = avctx->priv_data; AMRContext *s = avctx->priv_data;
s->frame_count = 0;
if (avctx->sample_rate != 8000) { if (avctx->sample_rate != 8000) {
av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n"); av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment