Revision 59b6482a libavformat/rtmppkt.c

View differences:

libavformat/rtmppkt.c
111 111
                extra = AV_RL32(buf);
112 112
            }
113 113
        }
114
        if (timestamp == 0xFFFFFF) {
115
            if (url_read_complete(h, buf, 4) != 4)
116
                return AVERROR(EIO);
117
            timestamp = AV_RB32(buf);
118
        }
114 119
    }
115 120
    if (ff_rtmp_packet_create(p, channel_id, type, timestamp, data_size))
116 121
        return -1;
......
148 153
    //TODO: header compression
149 154
    bytestream_put_byte(&p, pkt->channel_id | (mode << 6));
150 155
    if (mode != RTMP_PS_ONEBYTE) {
151
        bytestream_put_be24(&p, pkt->timestamp);
156
        bytestream_put_be24(&p, pkt->timestamp >= 0xFFFFFF ? 0xFFFFFF : pkt->timestamp);
152 157
        if (mode != RTMP_PS_FOURBYTES) {
153 158
            bytestream_put_be24(&p, pkt->data_size);
154 159
            bytestream_put_byte(&p, pkt->type);
155 160
            if (mode == RTMP_PS_TWELVEBYTES)
156 161
                bytestream_put_le32(&p, pkt->extra);
157 162
        }
163
        if (pkt->timestamp >= 0xFFFFFF)
164
            bytestream_put_be32(&p, pkt->timestamp);
158 165
    }
159 166
    url_write(h, pkt_hdr, p-pkt_hdr);
160 167
    while (off < pkt->data_size) {

Also available in: Unified diff