diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-12 12:28:09 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-12 12:28:09 +0000 |
commit | 1ae5708df3d0cc92f706564739ddd8c87a03467c (patch) | |
tree | a195ba04ab960142df91f9a40db3afc56292db3e /libmpdemux | |
parent | c164e2dd440f90dc0e7fd6cebf9e68ac28eb7b58 (diff) |
fail immediately if any of the parameters necessary to switch audio stream isn't set/correct; closes cid 55
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17823 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_mpg.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c index 8ff38881ce..e8a557d872 100644 --- a/libmpdemux/demux_mpg.c +++ b/libmpdemux/demux_mpg.c @@ -816,11 +816,15 @@ int demux_mpg_control(demuxer_t *demuxer,int cmd, void *arg){ 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++) { |