[FFmpeg-cvslog] oma: PCM support
David Goldwich
git at videolan.org
Mon Dec 5 00:43:09 CET 2011
ffmpeg | branch: master | David Goldwich <david.goldwich at gmail.com> | Fri Dec 2 05:54:21 2011 +0100| [c8b27a0ec4b36e20532c98469b7d9ee9dd31a8a9] | committer: Anton Khirnov
oma: PCM support
Signed-off-by: David Goldwich <david.goldwich at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c8b27a0ec4b36e20532c98469b7d9ee9dd31a8a9
---
Changelog | 1 +
libavformat/oma.c | 17 ++++++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/Changelog b/Changelog
index ff37020..bfb411e 100644
--- a/Changelog
+++ b/Changelog
@@ -104,6 +104,7 @@ easier to use. The changes are:
- OS X Video Decoder Acceleration (VDA) support
- CRI ADX audio format demuxer
- Playstation Portable PMP format demuxer
+- PCM format support in OMA demuxer
version 0.7:
diff --git a/libavformat/oma.c b/libavformat/oma.c
index 4f4837d..1aa9a25 100644
--- a/libavformat/oma.c
+++ b/libavformat/oma.c
@@ -61,9 +61,10 @@ enum {
};
static const AVCodecTag codec_oma_tags[] = {
- { CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 },
- { CODEC_ID_ATRAC3P, OMA_CODECID_ATRAC3P },
- { CODEC_ID_MP3, OMA_CODECID_MP3 },
+ { CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 },
+ { CODEC_ID_ATRAC3P, OMA_CODECID_ATRAC3P },
+ { CODEC_ID_MP3, OMA_CODECID_MP3 },
+ { CODEC_ID_PCM_S16BE, OMA_CODECID_LPCM },
};
static const uint64_t leaf_table[] = {
@@ -358,6 +359,16 @@ static int oma_read_header(AVFormatContext *s,
st->need_parsing = AVSTREAM_PARSE_FULL;
framesize = 1024;
break;
+ case OMA_CODECID_LPCM:
+ /* PCM 44.1 kHz 16 bit stereo big-endian */
+ st->codec->channels = 2;
+ st->codec->sample_rate = 44100;
+ framesize = 1024;
+ /* bit rate = sample rate x PCM block align (= 4) x 8 */
+ st->codec->bit_rate = st->codec->sample_rate * 32;
+ st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
+ avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
+ break;
default:
av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n",buf[32]);
return -1;
More information about the ffmpeg-cvslog
mailing list