diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-10 03:09:46 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-10 03:45:23 +0100 |
commit | afc0a24d7d60f855676d8069011624d52361d7ed (patch) | |
tree | 5480e1c0a3f177805d9a2a85321117a94a2bf878 /libavcodec/8svx.c | |
parent | dec354ba1dcc3c7858277d30c73dac030e2a441e (diff) | |
parent | f1f6d3615f3f9a81f41905ea0c8116b4985870e4 (diff) | |
download | ffmpeg-afc0a24d7d60f855676d8069011624d52361d7ed.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avcodec: add support for planar signed 8-bit PCM.
ra144enc: add sample_fmts list to ff_ra_144_encoder
smackaud: use uint8_t* for 8-bit output buffer type
smackaud: clip output samples
smackaud: use sign_extend() for difference value instead of casting
sipr: use a function pointer to select the decode_frame function
sipr: set mode based on block_align instead of bit_rate
sipr: do not needlessly set *data_size to 0 when returning an error
ra288: fix formatting of LOCAL_ALIGNED_16
udp: Allow specifying the local IP address
VC1: Add bottom field offset to block_index[] to avoid rewriting (+10L)
vc1dec: move an if() block.
vc1dec: use correct hybrid prediction threshold.
vc1dec: Partial rewrite of vc1_pred_mv()
vc1dec: take ME precision into account while scaling MV predictors.
lavf: don't leak corrupted packets
Conflicts:
libavcodec/8svx.c
libavcodec/ra288.c
libavcodec/version.h
libavformat/iff.c
libavformat/udp.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/8svx.c')
-rw-r--r-- | libavcodec/8svx.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 5c68d347e2..efe554adc2 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -110,7 +110,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *data_si if (!esc->samples && avpkt) { uint8_t *deinterleaved_samples; - esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW ? + esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW || avctx->codec->id ==CODEC_ID_PCM_S8_PLANAR? avpkt->size : avctx->channels + (avpkt->size-avctx->channels) * 2; if (!(esc->samples = av_malloc(esc->samples_size))) return AVERROR(ENOMEM); @@ -168,7 +168,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx) { EightSvxContext *esc = avctx->priv_data; - if (avctx->channels > 2) { + if (avctx->channels < 1 || avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n"); return AVERROR_INVALIDDATA; } @@ -176,6 +176,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx) switch (avctx->codec->id) { case CODEC_ID_8SVX_FIB: esc->table = fibonacci; break; case CODEC_ID_8SVX_EXP: esc->table = exponential; break; + case CODEC_ID_PCM_S8_PLANAR: case CODEC_ID_8SVX_RAW: esc->table = NULL; break; default: av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id); @@ -219,13 +220,13 @@ AVCodec ff_eightsvx_exp_decoder = { .long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"), }; -AVCodec ff_eightsvx_raw_decoder = { - .name = "8svx_raw", - .type = AVMEDIA_TYPE_AUDIO, - .id = CODEC_ID_8SVX_RAW, - .priv_data_size = sizeof(EightSvxContext), - .init = eightsvx_decode_init, - .decode = eightsvx_decode_frame, - .close = eightsvx_decode_close, - .long_name = NULL_IF_CONFIG_SMALL("8SVX rawaudio"), +AVCodec ff_pcm_s8_planar_decoder = { + .name = "pcm_s8_planar", + .type = AVMEDIA_TYPE_AUDIO, + .id = CODEC_ID_PCM_S8_PLANAR, + .priv_data_size = sizeof(EightSvxContext), + .init = eightsvx_decode_init, + .close = eightsvx_decode_close, + .decode = eightsvx_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("PCM signed 8-bit planar"), }; |