| 313 | |
| 314 | static struct subtitle_list *subtitles; |
| 315 | static void set_subtitle(void) |
| 316 | { |
| 317 | struct subtitle_part *sp; |
| 318 | struct subtitle_list *pos, *tmp; |
| 319 | |
| 320 | for (pos = subtitles; pos != NULL; pos = tmp) { |
| 321 | tmp = pos->next; |
| 322 | free(pos); |
| 323 | } |
| 324 | |
| 325 | subtitles = NULL; |
| 326 | list_for_each_entry(sp, &trail, entries) { |
| 327 | if (sp->text) { |
| 328 | if (pos) { |
| 329 | pos->next = xcalloc(1, sizeof(*pos)); |
| 330 | pos = pos->next; |
| 331 | } else { |
| 332 | subtitles = pos = xcalloc(1, sizeof(*pos)); |
| 333 | } |
| 334 | pos->text = sp->text; |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | set_dialog_subtitles(subtitles); |
| 339 | } |
| 340 | |
| 341 | static void reset_subtitle(void) |
| 342 | { |
no test coverage detected