| 1139 | } |
| 1140 | |
| 1141 | static uint8_t *get_line(AVIOContext *s) |
| 1142 | { |
| 1143 | AVIOContext *line; |
| 1144 | uint8_t *buf; |
| 1145 | char c; |
| 1146 | |
| 1147 | if (avio_open_dyn_buf(&line) < 0) { |
| 1148 | av_log(NULL, AV_LOG_FATAL, "Could not alloc buffer for reading preset.\n"); |
| 1149 | exit_program(1); |
| 1150 | } |
| 1151 | |
| 1152 | while ((c = avio_r8(s)) && c != '\n') |
| 1153 | avio_w8(line, c); |
| 1154 | avio_w8(line, 0); |
| 1155 | avio_close_dyn_buf(line, &buf); |
| 1156 | |
| 1157 | return buf; |
| 1158 | } |
| 1159 | |
| 1160 | static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s) |
| 1161 | { |
no test coverage detected