changeset 22447:e2b4f45ad2d1

Fix DEMUXER_CTRL_GET_PERCENT_POS with -novideo
author reimar
date Mon, 05 Mar 2007 12:56:41 +0000
parents b91e394da1c2
children 81d9984fa1eb
files libmpdemux/demux_avs.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_avs.c	Mon Mar 05 12:53:43 2007 +0000
+++ b/libmpdemux/demux_avs.c	Mon Mar 05 12:56:41 2007 +0000
@@ -378,8 +378,10 @@
         }
         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: