diff options
author | Måns Rullgård <mans@mansr.com> | 2005-05-13 18:10:23 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2005-05-13 18:10:23 +0000 |
commit | ad2b531d3ffbcb074a81f8e6a35f500519b6909a (patch) | |
tree | 5ce84049af3d414a4aeb1964123fceeda12b7cc2 /libavformat/matroska.c | |
parent | e817a73daa7e6f473cd793d8c84424536282b163 (diff) | |
download | ffmpeg-ad2b531d3ffbcb074a81f8e6a35f500519b6909a.tar.gz |
change extradata format for vorbis
Originally committed as revision 4235 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroska.c')
-rw-r--r-- | libavformat/matroska.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/libavformat/matroska.c b/libavformat/matroska.c index b0c62ad882..cc23781d85 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -2243,44 +2243,13 @@ matroska_read_header (AVFormatContext *s, /* codec_id = CODEC_ID_DTS; */ else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_AUDIO_VORBIS)) { - unsigned char *p = track->codec_priv, *cdp; - int cps = track->codec_priv_size; - int nf, s[3], cds; - int i; - - nf = *p++; - cps--; - - if(nf != 2) - continue; - - for(i = 0; i < 2; i++){ - int xv; - s[i] = 0; - do { - xv = *p++; - s[i] += xv; - cps--; - } while(xv == 255); + extradata_size = track->codec_priv_size; + if(extradata_size) { + extradata = av_malloc(extradata_size); + if(extradata == NULL) + return AVERROR_NOMEM; + memcpy(extradata, track->codec_priv, extradata_size); } - - s[2] = cps - s[0] - s[1]; - - cds = cps + 6; - extradata = cdp = av_malloc(cds); - if(extradata == NULL) - return AVERROR_NOMEM; - extradata_size = cds; - - for(i = 0; i < 3; i++){ - *cdp++ = s[i] >> 8; - *cdp++ = s[i] & 0xff; - memcpy(cdp, p, s[i]); - cdp += s[i]; - p += s[i]; - cps -= s[i]; - } - codec_id = CODEC_ID_VORBIS; } else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_AUDIO_MPEG2) || |