| 134 | } |
| 135 | |
| 136 | static void writeout(AVIOContext *s, const uint8_t *data, int len) |
| 137 | { |
| 138 | FFIOContext *const ctx = ffiocontext(s); |
| 139 | if (!s->error) { |
| 140 | int ret = 0; |
| 141 | if (s->write_data_type) |
| 142 | ret = s->write_data_type(s->opaque, data, |
| 143 | len, |
| 144 | ctx->current_type, |
| 145 | ctx->last_time); |
| 146 | else if (s->write_packet) |
| 147 | ret = s->write_packet(s->opaque, data, len); |
| 148 | if (ret < 0) { |
| 149 | s->error = ret; |
| 150 | } else { |
| 151 | ctx->bytes_written += len; |
| 152 | s->bytes_written = ctx->bytes_written; |
| 153 | |
| 154 | if (s->pos + len > ctx->written_output_size) { |
| 155 | ctx->written_output_size = s->pos + len; |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | if (ctx->current_type == AVIO_DATA_MARKER_SYNC_POINT || |
| 160 | ctx->current_type == AVIO_DATA_MARKER_BOUNDARY_POINT) { |
| 161 | ctx->current_type = AVIO_DATA_MARKER_UNKNOWN; |
| 162 | } |
| 163 | ctx->last_time = AV_NOPTS_VALUE; |
| 164 | ctx->writeout_count++; |
| 165 | s->pos += len; |
| 166 | } |
| 167 | |
| 168 | static void flush_buffer(AVIOContext *s) |
| 169 | { |
no outgoing calls
no test coverage detected