mirror of
https://github.com/mpv-player/mpv
synced 2024-12-14 19:05:33 +00:00
fix crash if no video codec available
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17343 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
757387a4fc
commit
3b31501ff7
@ -837,13 +837,13 @@ static int demux_avi_control(demuxer_t *demuxer,int cmd, void *arg){
|
||||
|
||||
switch(cmd) {
|
||||
case DEMUXER_CTRL_GET_TIME_LENGTH:
|
||||
if (!priv->numberofframes) return DEMUXER_CTRL_DONTKNOW;
|
||||
if (!priv->numberofframes || !sh_video) return DEMUXER_CTRL_DONTKNOW;
|
||||
*((double *)arg)=(double)priv->numberofframes/sh_video->fps;
|
||||
if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS;
|
||||
return DEMUXER_CTRL_OK;
|
||||
|
||||
case DEMUXER_CTRL_GET_PERCENT_POS:
|
||||
if (!priv->numberofframes) {
|
||||
if (!priv->numberofframes || !sh_video) {
|
||||
return DEMUXER_CTRL_DONTKNOW;
|
||||
}
|
||||
*((int *)arg)=(int)(priv->video_pack_no*100/priv->numberofframes);
|
||||
|
Loading…
Reference in New Issue
Block a user