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

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavformat/siff.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:
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
 */
21
21
 
 
22
#include "libavutil/channel_layout.h"
22
23
#include "libavutil/intreadwrite.h"
23
24
#include "avformat.h"
24
25
#include "internal.h"
76
77
    if (!ast)
77
78
        return -1;
78
79
    ast->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
79
 
    ast->codec->codec_id        = CODEC_ID_PCM_U8;
 
80
    ast->codec->codec_id        = AV_CODEC_ID_PCM_U8;
80
81
    ast->codec->channels        = 1;
81
 
    ast->codec->bits_per_coded_sample = c->bits;
 
82
    ast->codec->channel_layout  = AV_CH_LAYOUT_MONO;
 
83
    ast->codec->bits_per_coded_sample = 8;
82
84
    ast->codec->sample_rate     = c->rate;
83
 
    ast->codec->frame_size      = c->block_align;
84
85
    avpriv_set_pts_info(ast, 16, 1, c->rate);
 
86
    ast->start_time = 0;
85
87
    return 0;
86
88
}
87
89
 
120
122
    if (!st)
121
123
        return -1;
122
124
    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
123
 
    st->codec->codec_id   = CODEC_ID_VB;
 
125
    st->codec->codec_id   = AV_CODEC_ID_VB;
124
126
    st->codec->codec_tag  = MKTAG('V', 'B', 'V', '1');
125
127
    st->codec->width      = width;
126
128
    st->codec->height     = height;
127
 
    st->codec->pix_fmt    = PIX_FMT_PAL8;
 
129
    st->codec->pix_fmt    = AV_PIX_FMT_PAL8;
128
130
    avpriv_set_pts_info(st, 16, 1, 12);
129
131
 
130
132
    c->cur_frame = 0;
153
155
    return create_audio_stream(s, c);
154
156
}
155
157
 
156
 
static int siff_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
158
static int siff_read_header(AVFormatContext *s)
157
159
{
158
160
    AVIOContext *pb = s->pb;
159
161
    SIFFContext *c = s->priv_data;
211
213
            pkt->stream_index = 0;
212
214
            c->curstrm = -1;
213
215
        }else{
214
 
            if (av_get_packet(s->pb, pkt, c->sndsize - 4) < 0)
 
216
            if ((size = av_get_packet(s->pb, pkt, c->sndsize - 4)) < 0)
215
217
                return AVERROR(EIO);
216
218
            pkt->stream_index = 1;
 
219
            pkt->duration     = size;
217
220
            c->curstrm = 0;
218
221
        }
219
222
        if(!c->cur_frame || c->curstrm)
224
227
        size = av_get_packet(s->pb, pkt, c->block_align);
225
228
        if(size <= 0)
226
229
            return AVERROR(EIO);
 
230
        pkt->duration = size;
227
231
    }
228
232
    return pkt->size;
229
233
}
235
239
    .read_probe     = siff_probe,
236
240
    .read_header    = siff_read_header,
237
241
    .read_packet    = siff_read_packet,
238
 
    .extensions = "vb,son"
 
242
    .extensions     = "vb,son",
239
243
};