# HG changeset patch # User reimar # Date 1211402765 0 # Node ID 089ac698f8b1155d9dabf379afe6a36751cbad44 # Parent a0c157a99aacd684b237063c988c332eac2c378b Avoid crash with video stream switching and -nosound diff -r a0c157a99aac -r 089ac698f8b1 mplayer.c --- a/mplayer.c Wed May 21 18:45:30 2008 +0000 +++ b/mplayer.c Wed May 21 20:46:05 2008 +0000 @@ -3692,7 +3692,9 @@ if(!mpctx->sh_video) { // handle audio-only case: double a_pos=0; - if(!quiet || end_at.type == END_AT_TIME ) + // sh_audio can be NULL due to video stream switching + // TODO: handle this better + if((!quiet || end_at.type == END_AT_TIME) && mpctx->sh_audio) a_pos = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out); if(!quiet)