comparison g726.c @ 7451:85ab7655ad4d libavcodec

Modify all codecs to report their supported input and output sample format(s).
author pross
date Thu, 31 Jul 2008 10:47:31 +0000
parents 6f70dc804076
children a570a1e80400
comparison
equal deleted inserted replaced
7450:30d38a880fde 7451:85ab7655ad4d
321 avctx->coded_frame = avcodec_alloc_frame(); 321 avctx->coded_frame = avcodec_alloc_frame();
322 if (!avctx->coded_frame) 322 if (!avctx->coded_frame)
323 return AVERROR(ENOMEM); 323 return AVERROR(ENOMEM);
324 avctx->coded_frame->key_frame = 1; 324 avctx->coded_frame->key_frame = 1;
325 325
326 if (avctx->codec->decode)
327 avctx->sample_fmt = SAMPLE_FMT_S16;
328
326 return 0; 329 return 0;
327 } 330 }
328 331
329 static av_cold int g726_close(AVCodecContext *avctx) 332 static av_cold int g726_close(AVCodecContext *avctx)
330 { 333 {
379 sizeof(G726Context), 382 sizeof(G726Context),
380 g726_init, 383 g726_init,
381 g726_encode_frame, 384 g726_encode_frame,
382 g726_close, 385 g726_close,
383 NULL, 386 NULL,
387 .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
384 .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), 388 .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
385 }; 389 };
386 #endif //CONFIG_ENCODERS 390 #endif //CONFIG_ENCODERS
387 391
388 AVCodec adpcm_g726_decoder = { 392 AVCodec adpcm_g726_decoder = {