Revision 6b10228a

View differences:

libavformat/Makefile
100 100
OBJS-$(CONFIG_M4V_DEMUXER)               += raw.o
101 101
OBJS-$(CONFIG_M4V_MUXER)                 += raw.o
102 102
OBJS-$(CONFIG_MATROSKA_DEMUXER)          += matroskadec.o matroska.o \
103
                                            riff.o isom.o
103
                                            riff.o isom.o rm.o
104 104
OBJS-$(CONFIG_MATROSKA_MUXER)            += matroskaenc.o matroska.o \
105 105
                                            riff.o isom.o avc.o flacenc.o
106 106
OBJS-$(CONFIG_MJPEG_DEMUXER)             += raw.o
libavformat/matroska.c
45 45
    {"A_REAL/28_8"      , CODEC_ID_RA_288},
46 46
    {"A_REAL/ATRC"      , CODEC_ID_ATRAC3},
47 47
    {"A_REAL/COOK"      , CODEC_ID_COOK},
48
//    {"A_REAL/SIPR"      , CODEC_ID_SIPRO},
48
    {"A_REAL/SIPR"      , CODEC_ID_SIPR},
49 49
    {"A_TRUEHD"         , CODEC_ID_TRUEHD},
50 50
    {"A_TTA1"           , CODEC_ID_TTA},
51 51
    {"A_VORBIS"         , CODEC_ID_VORBIS},
libavformat/matroskadec.c
33 33
/* For ff_codec_get_id(). */
34 34
#include "riff.h"
35 35
#include "isom.h"
36
#include "rm.h"
36 37
#include "matroska.h"
37 38
#include "libavcodec/mpeg4audio.h"
38 39
#include "libavutil/intfloat_readwrite.h"
......
1312 1313
            track->audio.out_samplerate = 8000;
1313 1314
            track->audio.channels = 1;
1314 1315
        } else if (codec_id == CODEC_ID_RA_288 || codec_id == CODEC_ID_COOK ||
1315
                   codec_id == CODEC_ID_ATRAC3) {
1316
                   codec_id == CODEC_ID_ATRAC3 || codec_id == CODEC_ID_SIPR) {
1317
            int flavor;
1316 1318
            init_put_byte(&b, track->codec_priv.data,track->codec_priv.size,
1317 1319
                          0, NULL, NULL, NULL, NULL);
1318
            url_fskip(&b, 24);
1320
            url_fskip(&b, 22);
1321
            flavor                       = get_be16(&b);
1319 1322
            track->audio.coded_framesize = get_be32(&b);
1320 1323
            url_fskip(&b, 12);
1321 1324
            track->audio.sub_packet_h    = get_be16(&b);
......
1326 1329
                st->codec->block_align = track->audio.coded_framesize;
1327 1330
                track->codec_priv.size = 0;
1328 1331
            } else {
1332
                if (codec_id == CODEC_ID_SIPR && flavor < 4) {
1333
                    const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 };
1334
                    track->audio.sub_packet_size = ff_sipr_subpk_size[flavor];
1335
                    st->codec->bit_rate = sipr_bit_rate[flavor];
1336
                }
1329 1337
                st->codec->block_align = track->audio.sub_packet_size;
1330 1338
                extradata_offset = 78;
1331 1339
            }
......
1638 1646
        for (n = 0; n < laces; n++) {
1639 1647
            if ((st->codec->codec_id == CODEC_ID_RA_288 ||
1640 1648
                 st->codec->codec_id == CODEC_ID_COOK ||
1649
                 st->codec->codec_id == CODEC_ID_SIPR ||
1641 1650
                 st->codec->codec_id == CODEC_ID_ATRAC3) &&
1642 1651
                 st->codec->block_align && track->audio.sub_packet_size) {
1643 1652
                int a = st->codec->block_align;
......
1653 1662
                        for (x=0; x<h/2; x++)
1654 1663
                            memcpy(track->audio.buf+x*2*w+y*cfs,
1655 1664
                                   data+x*cfs, cfs);
1665
                    else if (st->codec->codec_id == CODEC_ID_SIPR)
1666
                        memcpy(track->audio.buf + y*w, data, w);
1656 1667
                    else
1657 1668
                        for (x=0; x<w/sps; x++)
1658 1669
                            memcpy(track->audio.buf+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), data+x*sps, sps);
1659 1670

  
1660 1671
                    if (++track->audio.sub_packet_cnt >= h) {
1672
                        if (st->codec->codec_id == CODEC_ID_SIPR)
1673
                            ff_rm_reorder_sipr_data(track->audio.buf, h, w);
1661 1674
                        track->audio.sub_packet_cnt = 0;
1662 1675
                        track->audio.pkt_cnt = h*w / a;
1663 1676
                    }

Also available in: Unified diff