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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 17:07:00 UTC
  • mfrom: (1.1.17) (7.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130924170700-4dg62s3pwl0pdakz
Tags: 1.2.0-1
* New upstream stable release:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * @author Peter Ross <pross@xvid.org>
26
26
 */
27
27
 
 
28
#include "libavutil/channel_layout.h"
28
29
#include "libavutil/intreadwrite.h"
29
30
#include "avformat.h"
30
31
#include "internal.h"
58
59
    return 0;
59
60
}
60
61
 
61
 
static int read_header(AVFormatContext *s,
62
 
                       AVFormatParameters *ap)
 
62
static int read_header(AVFormatContext *s)
63
63
{
64
64
    JVDemuxContext *jv = s->priv_data;
65
65
    AVIOContext *pb = s->pb;
76
76
        return AVERROR(ENOMEM);
77
77
 
78
78
    vst->codec->codec_type  = AVMEDIA_TYPE_VIDEO;
79
 
    vst->codec->codec_id    = CODEC_ID_JV;
 
79
    vst->codec->codec_id    = AV_CODEC_ID_JV;
80
80
    vst->codec->codec_tag   = 0; /* no fourcc */
81
81
    vst->codec->width       = avio_rl16(pb);
82
82
    vst->codec->height      = avio_rl16(pb);
 
83
    vst->duration           =
83
84
    vst->nb_frames          =
84
85
    ast->nb_index_entries   = avio_rl16(pb);
85
86
    avpriv_set_pts_info(vst, 64, avio_rl16(pb), 1000);
87
88
    avio_skip(pb, 4);
88
89
 
89
90
    ast->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
90
 
    ast->codec->codec_id    = CODEC_ID_PCM_U8;
 
91
    ast->codec->codec_id    = AV_CODEC_ID_PCM_U8;
91
92
    ast->codec->codec_tag   = 0; /* no fourcc */
92
93
    ast->codec->sample_rate = avio_rl16(pb);
93
94
    ast->codec->channels    = 1;
 
95
    ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
94
96
    avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
95
97
 
96
98
    avio_skip(pb, 10);
208
210
 
209
211
    if (i < 0 || i >= ast->nb_index_entries)
210
212
        return 0;
 
213
    if (avio_seek(s->pb, ast->index_entries[i].pos, SEEK_SET) < 0)
 
214
        return -1;
211
215
 
212
216
    jv->state = JV_AUDIO;
213
217
    jv->pts   = i;
214
 
    avio_seek(s->pb, ast->index_entries[i].pos, SEEK_SET);
215
218
    return 0;
216
219
}
217
220