Revision 51c3861e libavformat/daud.c

View differences:

libavformat/daud.c
47 47
    return ret;
48 48
}
49 49

  
50
static int daud_write_header(struct AVFormatContext *s)
51
{
52
    AVCodecContext *codec = s->streams[0]->codec;
53
    if (codec->channels!=6 || codec->sample_rate!=96000)
54
        return -1;
55
    return 0;
56
}
57

  
58
static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
59
{
60
    put_be16(s->pb, pkt->size);
61
    put_be16(s->pb, 0x8010); // unknown
62
    put_buffer(s->pb, pkt->data, pkt->size);
63
    put_flush_packet(s->pb);
64
    return 0;
65
}
66

  
67
#if CONFIG_DAUD_DEMUXER
50 68
AVInputFormat daud_demuxer = {
51 69
    "daud",
52 70
    NULL_IF_CONFIG_SMALL("D-Cinema audio format"),
......
58 76
    NULL,
59 77
    .extensions = "302",
60 78
};
79
#endif
80

  
81
#ifdef CONFIG_DAUD_MUXER
82
AVOutputFormat daud_muxer =
83
{
84
    "daud",
85
    NULL_IF_CONFIG_SMALL("D-Cinema audio format"),
86
    NULL,
87
    "302",
88
    0,
89
    CODEC_ID_PCM_S24DAUD,
90
    CODEC_ID_NONE,
91
    daud_write_header,
92
    daud_write_packet,
93
    .flags= AVFMT_NOTIMESTAMPS,
94
};
95
#endif

Also available in: Unified diff