Revision 8bb57775

View differences:

libavformat/bethsoftvid.c
58 58
static int vid_read_header(AVFormatContext *s,
59 59
                            AVFormatParameters *ap)
60 60
{
61
    BVID_DemuxContext *vid = s->priv_data;     // permanent data outside of function
62
    ByteIOContext *pb = &s->pb;                // io to file
61
    BVID_DemuxContext *vid = s->priv_data;
62
    ByteIOContext *pb = &s->pb;
63 63
    AVStream *stream;
64 64

  
65 65
    /* load main header. Contents:
......
69 69
    url_fseek(pb, 5, SEEK_CUR);
70 70
    vid->nframes = get_le16(pb);
71 71

  
72
    // FFmpeg central code will use this; don't need to return or anything
73
    // initialize the bethsoft codec
74 72
    stream = av_new_stream(s, 0);
75 73
    if (!stream)
76 74
        return AVERROR_NOMEM;
......
115 113
    // save the file position for the packet, include block type
116 114
    position = url_ftell(pb) - 1;
117 115

  
118
    // set the block type for the decoder
119 116
    vidbuf_start[vidbuf_nbytes++] = block_type;
120 117

  
121 118
    // get the video delay (next int16), and set the presentation time
......
176 173
static int vid_read_packet(AVFormatContext *s,
177 174
                           AVPacket *pkt)
178 175
{
179
    BVID_DemuxContext *vid = s->priv_data;     // permanent data outside of function
180
    ByteIOContext *pb = &s->pb;                // io to file
181
    unsigned char block_type;                  // block type
176
    BVID_DemuxContext *vid = s->priv_data;
177
    ByteIOContext *pb = &s->pb;
178
    unsigned char block_type;
182 179
    int audio_length;
183 180
    int ret_value;
184 181

  
......
198 195
            return ret_value;
199 196

  
200 197
        case FIRST_AUDIO_BLOCK:
201
            get_le16(pb); //    some unused constant
198
            get_le16(pb);
202 199
            // soundblaster DAC used for sample rate, as on specification page (link above)
203 200
            s->streams[1]->codec->sample_rate = 1000000 / (256 - get_byte(pb));
204 201
            s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_sample;

Also available in: Unified diff