~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavformat/oggparsespeex.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <stdlib.h>
26
26
#include "libavutil/bswap.h"
27
27
#include "libavutil/avstring.h"
 
28
#include "libavutil/channel_layout.h"
28
29
#include "libavcodec/get_bits.h"
29
30
#include "libavcodec/bytestream.h"
30
31
#include "avformat.h"
55
56
    if (spxp->seq == 0) {
56
57
        int frames_per_packet;
57
58
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
58
 
        st->codec->codec_id = CODEC_ID_SPEEX;
 
59
        st->codec->codec_id = AV_CODEC_ID_SPEEX;
59
60
 
60
61
        st->codec->sample_rate = AV_RL32(p + 36);
61
62
        st->codec->channels = AV_RL32(p + 48);
 
63
        if (st->codec->channels < 1 || st->codec->channels > 2) {
 
64
            av_log(s, AV_LOG_ERROR, "invalid channel count. Speex must be mono or stereo.\n");
 
65
            return AVERROR_INVALIDDATA;
 
66
        }
 
67
        st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO :
 
68
                                                               AV_CH_LAYOUT_STEREO;
62
69
 
63
70
        spxp->packet_size  = AV_RL32(p + 56);
64
71
        frames_per_packet  = AV_RL32(p + 64);
122
129
    .magic = "Speex   ",
123
130
    .magicsize = 8,
124
131
    .header = speex_header,
125
 
    .packet = speex_packet
 
132
    .packet = speex_packet,
 
133
    .nb_header = 2,
126
134
};