Fix DEMUXER_CTRL_GET_PERCENT_POS with -novideo
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 5 Mar 2007 12:56:41 +0000 (12:56 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 5 Mar 2007 12:56:41 +0000 (12:56 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@22465 b3059339-0415-0410-9bf9-f77b7e298cf2

libmpdemux/demux_avs.c

index 32950f8..c2e177c 100644 (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: