These are both not const and need to be freed after we're done.
Unified · Split
| @@ -270,20 +270,22 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg) · 269 unmodified lines | ||
| 270 | 270 | int title = *(double *)arg; |
| 271 | 271 | if (!b->bd || title < 0 || title >= b->num_titles) |
| 272 | 272 | return STREAM_UNSUPPORTED; |
| 273 | − const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); | |
| 273 | + BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); | |
| 274 | 274 | if (!ti) |
| 275 | 275 | return STREAM_UNSUPPORTED; |
| 276 | 276 | *(double *)arg = BD_TIME_TO_MP(ti->duration); |
| 277 | + bd_free_title_info(ti); | |
| 277 | 278 | return STREAM_OK; |
| 278 | 279 | } |
| 279 | 280 | case STREAM_CTRL_GET_TITLE_PLAYLIST: { |
| 280 | 281 | int title = *(double *)arg; |
| 281 | 282 | if (!b->bd || title < 0 || title >= b->num_titles) |
| 282 | 283 | return STREAM_UNSUPPORTED; |
| 283 | − const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); | |
| 284 | + BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); | |
| 284 | 285 | if (!ti) |
| 285 | 286 | return STREAM_UNSUPPORTED; |
| 286 | 287 | *(double *)arg = ti->playlist; |
| 288 | + bd_free_title_info(ti); | |
| 287 | 289 | return STREAM_OK; |
| 288 | 290 | } |
| 289 | 291 | case STREAM_CTRL_GET_LANG: { |