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 | int title = *(double *)arg; | 270 | int title = *(double *)arg; |
| 271 | if (!b->bd || title < 0 || title >= b->num_titles) | 271 | if (!b->bd || title < 0 || title >= b->num_titles) |
| 272 | return STREAM_UNSUPPORTED; | 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 | if (!ti) | 274 | if (!ti) |
| 275 | return STREAM_UNSUPPORTED; | 275 | return STREAM_UNSUPPORTED; |
| 276 | *(double *)arg = BD_TIME_TO_MP(ti->duration); | 276 | *(double *)arg = BD_TIME_TO_MP(ti->duration); |
| 277 | bd_free_title_info(ti); | ||
| 277 | return STREAM_OK; | 278 | return STREAM_OK; |
| 278 | } | 279 | } |
| 279 | case STREAM_CTRL_GET_TITLE_PLAYLIST: { | 280 | case STREAM_CTRL_GET_TITLE_PLAYLIST: { |
| 280 | int title = *(double *)arg; | 281 | int title = *(double *)arg; |
| 281 | if (!b->bd || title < 0 || title >= b->num_titles) | 282 | if (!b->bd || title < 0 || title >= b->num_titles) |
| 282 | return STREAM_UNSUPPORTED; | 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 | if (!ti) | 285 | if (!ti) |
| 285 | return STREAM_UNSUPPORTED; | 286 | return STREAM_UNSUPPORTED; |
| 286 | *(double *)arg = ti->playlist; | 287 | *(double *)arg = ti->playlist; |
| 288 | bd_free_title_info(ti); | ||
| 287 | return STREAM_OK; | 289 | return STREAM_OK; |
| 288 | } | 290 | } |
| 289 | case STREAM_CTRL_GET_LANG: { | 291 | case STREAM_CTRL_GET_LANG: { |