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

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Fri Dec 28 13:01:52 CET 2018


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

Comment #3 by Federico ALLEGRETTI:

after some trials with this testing code:
' Gambas class file

Public player As MediaPlayer
Public uscita As MediaControl

Public Sub Form_Open()
  
  player = New MediaPlayer
  uscita = New MediaControl(player, "fakesink")
  player.Audio.Output = uscita
  player.URL = Media.URL("path_to_the_mp3_song")
  
  player.Play 
  While player.Duration = 0
    Wait 0.1
  Wend
  
  Print player.Duration
  player.Stop
  
End

i found there was some weird error in the mp3 coding.

with the original bad.mp3 song, loop never exit, but if i fix the mp3 with:

ffmpeg -i bad.mp3 -c:a copy good.mp3

than the test code with "good.mp3" reports correct lenght.

Strange thing is that (using autoaudiosink) gstreamer plays back both bad.mp3 and good.mp3

attached are bad.mp3 and converted good.mp3




More information about the Bugtracker mailing list