changeset 17822:24fc4279bf99

fail immediately if any of the parameters necessary to switch audio stream isn't set/correct; closes cid 55
author nicodvb
date Sun, 12 Mar 2006 12:28:09 +0000
parents 6be72b753b82
children 7f81c9ffa0b4
files libmpdemux/demux_mpg.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mpg.c	Sun Mar 12 12:13:37 2006 +0000
+++ b/libmpdemux/demux_mpg.c	Sun Mar 12 12:28:09 2006 +0000
@@ -816,11 +816,15 @@
 	    return DEMUXER_CTRL_DONTKNOW;
 
 	case DEMUXER_CTRL_SWITCH_AUDIO:
-            if (mpg_d && mpg_d->num_a_streams > 1 && demuxer->audio && demuxer->audio->sh) {
+            if(! (mpg_d && mpg_d->num_a_streams > 1 && demuxer->audio && demuxer->audio->sh))
+	      return DEMUXER_CTRL_NOTIMPL; 
+	    else {
               demux_stream_t *d_audio = demuxer->audio;
               sh_audio_t *sh_audio = d_audio->sh;
               sh_audio_t *sh_a = sh_audio;
               int i;
+	      if(!sh_audio)
+	        return DEMUXER_CTRL_NOTIMPL;
               if (*((int*)arg) < 0)
               {
               for (i = 0; i < mpg_d->num_a_streams; i++) {