Mercurial > mplayer.hg
comparison libmpdemux/demux_avi.c @ 17342:adb64d908347
fix crash if no video codec available
author | reimar |
---|---|
date | Sun, 08 Jan 2006 13:35:54 +0000 |
parents | 9081ae3a702c |
children | 934380353fd6 |
comparison
equal
deleted
inserted
replaced
17341:c919e346b0d1 | 17342:adb64d908347 |
---|---|
835 | 835 |
836 | 836 |
837 | 837 |
838 switch(cmd) { | 838 switch(cmd) { |
839 case DEMUXER_CTRL_GET_TIME_LENGTH: | 839 case DEMUXER_CTRL_GET_TIME_LENGTH: |
840 if (!priv->numberofframes) return DEMUXER_CTRL_DONTKNOW; | 840 if (!priv->numberofframes || !sh_video) return DEMUXER_CTRL_DONTKNOW; |
841 *((double *)arg)=(double)priv->numberofframes/sh_video->fps; | 841 *((double *)arg)=(double)priv->numberofframes/sh_video->fps; |
842 if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS; | 842 if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS; |
843 return DEMUXER_CTRL_OK; | 843 return DEMUXER_CTRL_OK; |
844 | 844 |
845 case DEMUXER_CTRL_GET_PERCENT_POS: | 845 case DEMUXER_CTRL_GET_PERCENT_POS: |
846 if (!priv->numberofframes) { | 846 if (!priv->numberofframes || !sh_video) { |
847 return DEMUXER_CTRL_DONTKNOW; | 847 return DEMUXER_CTRL_DONTKNOW; |
848 } | 848 } |
849 *((int *)arg)=(int)(priv->video_pack_no*100/priv->numberofframes); | 849 *((int *)arg)=(int)(priv->video_pack_no*100/priv->numberofframes); |
850 if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS; | 850 if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS; |
851 return DEMUXER_CTRL_OK; | 851 return DEMUXER_CTRL_OK; |