Currently it would crash, due to already canceled and freed resources.
Unified · Split
| @@ -1247,6 +1247,10 @@ static void open_demux_reentrant(struct MPContext *mpctx) · 1246 unmodified lines | |||
| 1247 | if (!mpctx->open_active) | 1247 | if (!mpctx->open_active) |
| 1248 | start_open(mpctx, url, mpctx->playing->stream_flags, false); | 1248 | start_open(mpctx, url, mpctx->playing->stream_flags, false); |
| 1249 | 1249 | ||
| 1250 | // If thread failed to start, cancel the playback | ||
| 1251 | if (!mpctx->open_active) | ||
| 1252 | goto cancel; | ||
| 1253 | |||
| 1250 | // User abort should cancel the opener now. | 1254 | // User abort should cancel the opener now. |
| 1251 | mp_cancel_set_parent(mpctx->open_cancel, mpctx->playback_abort); | 1255 | mp_cancel_set_parent(mpctx->open_cancel, mpctx->playback_abort); |
| 1252 | 1256 | ||
| @@ -1265,6 +1269,7 @@ static void open_demux_reentrant(struct MPContext *mpctx) · 12 unmodified lines | |||
| 1265 | mpctx->error_playing = mpctx->open_res_error; | 1269 | mpctx->error_playing = mpctx->open_res_error; |
| 1266 | } | 1270 | } |
| 1267 | 1271 | ||
| 1272 | cancel: | ||
| 1268 | cancel_open(mpctx); // cleanup | 1273 | cancel_open(mpctx); // cleanup |
| 1269 | } | 1274 | } |
| 1270 | 1275 | ||