~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libavcodec/g722dec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-12-21 15:32:13 UTC
  • mto: (1.2.18)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20121221153213-fudzrugjzivtv0wp
Tags: upstream-9~beta3
ImportĀ upstreamĀ versionĀ 9~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 *       respectively of each byte are ignored.
35
35
 */
36
36
 
 
37
#include "libavutil/channel_layout.h"
 
38
#include "libavutil/opt.h"
37
39
#include "avcodec.h"
38
40
#include "get_bits.h"
39
41
#include "g722.h"
40
 
#include "libavutil/opt.h"
 
42
#include "internal.h"
41
43
 
42
44
#define OFFSET(x) offsetof(G722Context, x)
43
45
#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
57
59
{
58
60
    G722Context *c = avctx->priv_data;
59
61
 
60
 
    if (avctx->channels != 1) {
61
 
        av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n");
62
 
        return AVERROR_INVALIDDATA;
63
 
    }
64
 
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
 
62
    avctx->channels       = 1;
 
63
    avctx->channel_layout = AV_CH_LAYOUT_MONO;
 
64
    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
65
65
 
66
66
    c->band[0].scale_factor = 8;
67
67
    c->band[1].scale_factor = 2;
96
96
 
97
97
    /* get output buffer */
98
98
    c->frame.nb_samples = avpkt->size * 2;
99
 
    if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
 
99
    if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
100
100
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
101
101
        return ret;
102
102
    }