Browse code

libopencore-amr: remove unneeded frame_count field.

Use AVCodecContext.frame_number instead.

Justin Ruggles authored on 2011/09/28 06:17:59
Showing 1 changed files
... ...
@@ -79,7 +79,6 @@ static int get_bitrate_mode(int bitrate, void *log_ctx)
79 79
 
80 80
 typedef struct AMRContext {
81 81
     AVClass *av_class;
82
-    int   frame_count;
83 82
     void *dec_state;
84 83
     void *enc_state;
85 84
     int   enc_bitrate;
... ...
@@ -100,7 +99,6 @@ static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
100 100
 {
101 101
     AMRContext *s  = avctx->priv_data;
102 102
 
103
-    s->frame_count = 0;
104 103
     s->dec_state   = Decoder_Interface_init();
105 104
     if (!s->dec_state) {
106 105
         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 136
     int packet_size;
137 137
 
138 138
     av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
139
-            buf, buf_size, s->frame_count);
139
+            buf, buf_size, avctx->frame_number);
140 140
 
141 141
     dec_mode    = (buf[0] >> 3) & 0x000F;
142 142
     packet_size = block_size[dec_mode] + 1;
... ...
@@ -147,7 +145,6 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
147 147
         return AVERROR_INVALIDDATA;
148 148
     }
149 149
 
150
-    s->frame_count++;
151 150
     av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
152 151
               packet_size, buf[0], buf[1], buf[2], buf[3]);
153 152
     /* call decoder */
... ...
@@ -172,8 +169,6 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
172 172
 {
173 173
     AMRContext *s = avctx->priv_data;
174 174
 
175
-    s->frame_count = 0;
176
-
177 175
     if (avctx->sample_rate != 8000) {
178 176
         av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
179 177
         return AVERROR(ENOSYS);