summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-07-14 01:32:14 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-07-14 01:32:14 +0000
commit23c992532927afa9d3a00677ff40cd071e21dc8f (patch)
tree232b97558b925172d4c6372c10a5c7e156469f27 /libavformat/mpeg.c
parenteb507b21c410515b179c0ca85b3db3d83fc296bd (diff)
libdts support by (Benjamin Zores <ben at geexbox dot org>)
Originally committed as revision 3310 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index dd4e524111..adf871a669 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -77,6 +77,7 @@ typedef struct {
#define AUDIO_ID 0xc0
#define VIDEO_ID 0xe0
#define AC3_ID 0x80
+#define DTS_ID 0x8a
#define LPCM_ID 0xa0
static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
@@ -235,7 +236,7 @@ static int get_system_header_size(AVFormatContext *ctx)
static int mpeg_mux_init(AVFormatContext *ctx)
{
MpegMuxContext *s = ctx->priv_data;
- int bitrate, i, mpa_id, mpv_id, ac3_id, lpcm_id, j;
+ int bitrate, i, mpa_id, mpv_id, ac3_id, dts_id, lpcm_id, j;
AVStream *st;
StreamInfo *stream;
int audio_bitrate;
@@ -258,6 +259,7 @@ static int mpeg_mux_init(AVFormatContext *ctx)
s->video_bound = 0;
mpa_id = AUDIO_ID;
ac3_id = AC3_ID;
+ dts_id = DTS_ID;
mpv_id = VIDEO_ID;
lpcm_id = LPCM_ID;
s->scr_stream_index = -1;
@@ -272,6 +274,8 @@ static int mpeg_mux_init(AVFormatContext *ctx)
case CODEC_TYPE_AUDIO:
if (st->codec.codec_id == CODEC_ID_AC3) {
stream->id = ac3_id++;
+ } else if (st->codec.codec_id == CODEC_ID_DTS) {
+ stream->id = dts_id++;
} else if (st->codec.codec_id == CODEC_ID_PCM_S16BE) {
stream->id = lpcm_id++;
for(j = 0; j < 4; j++) {
@@ -1304,9 +1308,12 @@ static int mpegps_read_packet(AVFormatContext *s,
} else if (startcode >= 0x1c0 && startcode <= 0x1df) {
type = CODEC_TYPE_AUDIO;
codec_id = CODEC_ID_MP2;
- } else if (startcode >= 0x80 && startcode <= 0x9f) {
+ } else if (startcode >= 0x80 && startcode <= 0x89) {
type = CODEC_TYPE_AUDIO;
codec_id = CODEC_ID_AC3;
+ } else if (startcode >= 0x8a && startcode <= 0x9f) {
+ type = CODEC_TYPE_AUDIO;
+ codec_id = CODEC_ID_DTS;
} else if (startcode >= 0xa0 && startcode <= 0xbf) {
type = CODEC_TYPE_AUDIO;
codec_id = CODEC_ID_PCM_S16BE;