-// case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8; break;
- case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16; break;
-// case 3: avctx->sample_fmt = AV_SAMPLE_FMT_S24; break;
- case 4: avctx->sample_fmt = AV_SAMPLE_FMT_S32; break;
- default:
- av_log_ask_for_sample(s->avctx,
- "Invalid/unsupported sample format.\n");
- return -1;
+ case 2:
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ avctx->bits_per_raw_sample = 16;
+ break;
+ case 3:
+ avctx->sample_fmt = AV_SAMPLE_FMT_S32;
+ avctx->bits_per_raw_sample = 24;
+ break;
+ default:
+ av_log(avctx, AV_LOG_ERROR, "Invalid/unsupported sample format.\n");
+ return AVERROR_INVALIDDATA;