Fix DEMUXER_CTRL_GET_PERCENT_POS with -novideo

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22465 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-03-05 12:56:41 +00:00
parent 4cb645c043
commit e18c2bd2d6
1 changed files with 3 additions and 1 deletions

View File

@ -378,8 +378,10 @@ static int demux_avs_control(demuxer_t *demuxer, int cmd, void *arg)
}
case DEMUXER_CTRL_GET_PERCENT_POS:
{
if (!AVS->video_info->num_frames) return DEMUXER_CTRL_DONTKNOW;
if (sh_video)
*((int *)arg) = AVS->frameno * 100 / AVS->video_info->num_frames;
else
*((int *)arg) = AVS->sampleno * 100 / AVS->video_info->num_audio_samples;
return DEMUXER_CTRL_OK;
}
default: