gst/modplug/gstmodplug.cc: Fix modplug duration query. Fixes #384294.

Original commit message from CVS:
Patch by: Jonathan Matthew <jonathan at kaolin wh9 net>).
* gst/modplug/gstmodplug.cc:
Fix modplug duration query. Fixes #384294.
This commit is contained in:
Jonathan Matthew 2006-12-11 09:51:17 +00:00 committed by Wim Taymans
parent f7d3a5f60b
commit baf6486f6c
2 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2006-12-11 Wim Taymans <wim@fluendo.com>
Patch by: Jonathan Matthew <jonathan at kaolin wh9 net>).
* gst/modplug/gstmodplug.cc:
Fix modplug duration query. Fixes #384294.
2006-12-08 Wim Taymans <wim@fluendo.com>
Patch by: René Stadler <mail at renestadler de>

View file

@ -317,13 +317,10 @@ gst_modplug_src_query (GstPad * pad, GstQuery * query)
gst_query_parse_position (query, &format, NULL);
if (format == GST_FORMAT_TIME) {
gfloat fpos;
gint64 pos;
fpos = ((float) (modplug->song_length *
modplug->mSoundFile->GetCurrentPos ()) /
(float) modplug->mSoundFile->GetMaxPosition ());
pos = (gint64) (fpos * GST_SECOND);
pos = (modplug->song_length * modplug->mSoundFile->GetCurrentPos ());
pos /= modplug->mSoundFile->GetMaxPosition ();
gst_query_set_position (query, format, pos);
res = TRUE;
}