| 245 | } |
| 246 | |
| 247 | int main(void) |
| 248 | { |
| 249 | const AVCodec *enc = NULL, *dec = NULL; |
| 250 | AVCodecContext *enc_ctx = NULL, *dec_ctx = NULL; |
| 251 | const AVChannelLayout channel_layouts[] = { AV_CHANNEL_LAYOUT_STEREO, |
| 252 | AV_CHANNEL_LAYOUT_5POINT1_BACK, |
| 253 | AV_CHANNEL_LAYOUT_SURROUND, |
| 254 | AV_CHANNEL_LAYOUT_STEREO_DOWNMIX }; |
| 255 | int sample_rates[] = {8000, 44100, 48000, 192000}; |
| 256 | int cl, sr; |
| 257 | |
| 258 | enc = avcodec_find_encoder(AV_CODEC_ID_FLAC); |
| 259 | if (!enc) { |
| 260 | av_log(NULL, AV_LOG_ERROR, "Can't find encoder\n"); |
| 261 | return 1; |
| 262 | } |
| 263 | |
| 264 | dec = avcodec_find_decoder(AV_CODEC_ID_FLAC); |
| 265 | if (!dec) { |
| 266 | av_log(NULL, AV_LOG_ERROR, "Can't find decoder\n"); |
| 267 | return 1; |
| 268 | } |
| 269 | |
| 270 | for (cl = 0; cl < FF_ARRAY_ELEMS(channel_layouts); cl++) { |
| 271 | for (sr = 0; sr < FF_ARRAY_ELEMS(sample_rates); sr++) { |
| 272 | if (init_encoder(enc, &enc_ctx, &channel_layouts[cl], sample_rates[sr]) != 0) |
| 273 | return 1; |
| 274 | if (init_decoder(dec, &dec_ctx, &channel_layouts[cl]) != 0) |
| 275 | return 1; |
| 276 | if (run_test(enc, dec, enc_ctx, dec_ctx) != 0) |
| 277 | return 1; |
| 278 | avcodec_free_context(&enc_ctx); |
| 279 | avcodec_free_context(&dec_ctx); |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | return 0; |
| 284 | } |
nothing calls this directly
no test coverage detected