changeset 26818:089ac698f8b1

Avoid crash with video stream switching and -nosound
author reimar
date Wed, 21 May 2008 20:46:05 +0000
parents a0c157a99aac
children d288ec15f2cc
files mplayer.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)