[Gambas-bugtracker] Bug #1487: gambas media player plays audio but duration always reports 0

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Mon Dec 24 17:55:15 CET 2018


http://gambaswiki.org/bugtracker/edit?object=BUG.1487&from=L21haW4-

Federico ALLEGRETTI reported a new bug.

Summary
-------

gambas media player plays audio but duration always reports 0

Type             : Bug
Priority         : Medium
Gambas version   : 3.11
Product          : Language


Description
-----------

' Gambas class file

Private Player_A As MediaPlayer   'player che gestira' i media con gb.media (gstreamer)
Private UscitaAudio As MediaControl 'l'area di rendering dei media
....

Public Sub CalcolaDurata(mediafile As String)
  
  Try Player_A.Close

  Player_A = New MediaPlayer As "FakeMediaPlayer"
  UscitaAudio = New MediaControl(Player_A, "autoaudiosink")
  'UscitaAudio = New MediaControl(Player_A, "fakeaudiosink")
  'UscitaAudio = New MediaControl(Player_A, "autoaudiosink")
  'UscitaAudio = New MediaControl(Player_A, "jackaudiosink")
  Player_A.Audio.Output = UscitaAudio

  Player_A.URL = Media.URL(mediafile)
  Player_A.play
  Print Player_A.Duration
  'Try Player_A.Play
  'Debug mediafile

  If Error Then
     Debug Error.Text & " on " & mediafile
     Else
     Player_A.Pause
     While Player_A.Duration = 0
        Wait 0.1
     Wend
     Debug Player_A.URL
  Endif
  
  Label_Duration.Text = HMS_From_Seconds(CString(Player_A.Duration))
  Player_A.Stop
  Player_A.Close

End


plays a clip perfect (on speakers when not fake sink is selected), but duration is always ZERO ....
PS: also the URL repors "" but audio is still cming from the speakers.


System information
------------------

[System]
Gambas=3.11.90
OperatingSystem=Linux
Kernel=4.15.0-43-generic
Architecture=x86_64
Distribution=Ubuntu 18.04.1 LTS
Desktop=UBUNTU:GNOME
Theme=Gtk
Language=it_IT.UTF-8
Memory=7919M

[Libraries]
Cairo=libcairo.so.2.11510.0
Curl=libcurl.so.4.5.0
DBus=libdbus-1.so.3.19.4
GStreamer=libgstreamer-1.0.so.0.1401.0
GTK+2=libgtk-x11-2.0.so.0.2400.32
GTK+3=libgtk-3.so.0.2200.30
OpenGL=libGL.so.1.0.0
Poppler=libpoppler.so.73.0.0
QT4=libQtCore.so.4.8.7
QT5=libQt5Core.so.5.9.5
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
CLUTTER_IM_MODULE=xim
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
DESKTOP_SESSION=ubuntu
DISPLAY=:1
GB_GUI=gb.qt4
GDMSESSION=ubuntu
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/gambas3.desktop
GIO_LAUNCHED_DESKTOP_FILE_PID=15516
GJS_DEBUG_OUTPUT=stderr
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SHELL_SESSION_MODE=ubuntu
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK_IM_MODULE=ibus
GTK_MODULES=gail:atk-bridge
HOME=<home>
IM_CONFIG_PHASE=2
LANG=it_IT.UTF-8
LOGNAME=<user>
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD=<home>
QT4_IM_MODULE=xim
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/1951,unix/<hostname>:/tmp/.ICE-unix/1951
SHELL=/bin/bash
SHLVL=0
SSH_AGENT_PID=2047
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
TEXTDOMAIN=im-config
TEXTDOMAINDIR=/usr/share/locale/
TZ=:/etc/localtime
USER=<user>
USERNAME=<user>
WINDOWPATH=2
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_ID=3
XDG_SESSION_TYPE=x11
XDG_VTNR=2
XMODIFIERS=@im=ibus




More information about the Bugtracker mailing list