Revision 4014fe37 libavformat/vocenc.c

View differences:

libavformat/vocenc.c
51 51
    ByteIOContext *pb = &s->pb;
52 52

  
53 53
    if (!voc->param_written) {
54
        int format = codec_get_tag(voc_codec_tags, enc->codec_id);
55

  
56
        if (format > 0xFF) {
54
        if (enc->codec_tag > 0xFF) {
57 55
            put_byte(pb, VOC_TYPE_NEW_VOICE_DATA);
58 56
            put_le24(pb, pkt->size + 12);
59 57
            put_le32(pb, enc->sample_rate);
60 58
            put_byte(pb, enc->bits_per_sample);
61 59
            put_byte(pb, enc->channels);
62
            put_le16(pb, format);
60
            put_le16(pb, enc->codec_tag);
63 61
            put_le32(pb, 0);
64 62
        } else {
65 63
            if (s->streams[0]->codec->channels > 1) {
66 64
                put_byte(pb, VOC_TYPE_EXTENDED);
67 65
                put_le24(pb, 4);
68 66
                put_le16(pb, 65536-256000000/(enc->sample_rate*enc->channels));
69
                put_byte(pb, format);
67
                put_byte(pb, enc->codec_tag);
70 68
                put_byte(pb, enc->channels - 1);
71 69
            }
72 70
            put_byte(pb, VOC_TYPE_VOICE_DATA);
73 71
            put_le24(pb, pkt->size + 2);
74 72
            put_byte(pb, 256 - 1000000 / enc->sample_rate);
75
            put_byte(pb, format);
73
            put_byte(pb, enc->codec_tag);
76 74
        }
77 75
        voc->param_written = 1;
78 76
    } else {

Also available in: Unified diff