~mdw
/
autoys
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3ebed7
)
gremlin/gremlin.in: Try querying duration early to guess bitrate.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 20 Apr 2018 12:21:24 +0000
(13:21 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 20 Apr 2018 12:21:24 +0000
(13:21 +0100)
This seems to work reliably now.
gremlin/gremlin.in
patch
|
blob
|
blame
|
history
diff --git
a/gremlin/gremlin.in
b/gremlin/gremlin.in
index
fe9491d
..
c0383ed
100644
(file)
--- a/
gremlin/gremlin.in
+++ b/
gremlin/gremlin.in
@@
-913,7
+913,10
@@
class AudioIdentifier (object):
elif 'bitrate' in tags and tags['bitrate'] >= 80000:
me._bitrate = tags['bitrate']/1000
else:
- me._bitrate = None
+ ok, n = pipe.query_duration(GS.Format.BYTES)
+ if ok: ok, t = pipe.query_duration(GS.Format.TIME)
+ if ok: me._bitrate = int((8e6*n)/t)
+ else: me._bitrate = None
pipe.set_state(GS.State.NULL)
@property