TCMP: *.ogg files always played in track loop mode

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

TCMP: *.ogg files always played in track loop mode

Post by *DrShark »

On my device with Android 4.3.1 and TC4A 2.81 beta 8, TC Media Player plays *.ogg files (preinstalled on device) in track loop mode even if other tracks are present in playlist. It's interestion that it doesn't happen with *.oga files (downloaded from internet) even after renaming to *.ogg.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, I don't understand what you mean. Do you mean that the other tracks are skipped? Maybe the player cannot play them?
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Yes, the player plays just the ogg track in a loop, even if other tracks are exist below in the playlist.
The sample of such ogg file (together with a sample of xspf playlist for other TC4A bugreport) went today to support email.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Got it, thanks - I will test it.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *DrShark »

I forgot to post here the reason of an issue:
Christian Ghisler by email wrote:This .ogg file is a ring tone - it has the ANDROID_LOOP flag set in the metadata. You can see it by opening the file with F3 in Lister (on Windows), switch to binary or text mode, and searching for ANDROID_LOOP. It will find:
ANDROID_LOOP=true

Apparently it's not possible to override this flag in the MediaPlayer control:
https://stackoverflow.com/questions/12834727/android-loop-true-how-to-avoid-mediaplayer-looping-audios-with-this-metada
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *ghisler(Author) »

Ah, I see, thanks for the info - that's really unfortunate then...
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *DrShark »

Could it be possible 'to work around this MediaPlayer control behavior by stopping the playback after the whole length of such an .ogg track with ANDROID_LOOP is played? An then to autostart the playback from the file in queue which is next after .ogg with ANDROID_LOOP. Yes, this way playback won't be "gapless", but maybe at least there won't be an undesired single file loop...
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *ghisler(Author) »

I would have to check that in the debugger. What was the name of the sample file you sent me in post 3? Or the name of the archive in which it was?
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *DrShark »

2ghisler(Author)
The attach name was "tc4a_bugfiles.zip", and the .ogg file name was "01.ogg".
For convenience, I just forwarded attach from that email from 2017 to your gmail address.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *ghisler(Author) »

Got it, thanks! Unfortunately I don't receive any kind of notification when the file loops. And my progress bar only works while the player is in the foreground, and checks the playback position manually every second. This wouldn't help to detect a 2 second loop.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *DrShark »

ghisler(Author) wrote: 2021-03-09, 15:29 UTCUnfortunately I don't receive any kind of notification when the file loops. And my progress bar [...] checks the playback position manually every second. This wouldn't help to detect a 2 second loop.
Does such a notification from Android needed for this? The player knows that playback is started, and it knows the track length, so if actual playback time of the track goes beyond its length, we can assume it's a loop andthen to switch to a next queue track (since this ANDROID_LOOP tag only seems to be present in *.ogg files, such an assumption can be limited only for *.ogg to avoid rare buggy cases when the file length (and so, actual playback of a track) is longer than reported by player). I think, it shouldn't be a problem even for 2- and 1-senonds etc. short tracks.
ghisler(Author) wrote: 2021-03-09, 15:29 UTCmy progress bar only works while the player is in the foreground
Does this mean the player doesn't know the length of the track when its playback starts in background?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TCMP: *.ogg files always played in track loop mode

Post by *ghisler(Author) »

The player knows that playback is started, and it knows the track length, so if actual playback time of the track goes beyond its length
It's not so simple - the user can also make the playback faster/slower, or pause it.
Does this mean the player doesn't know the length of the track when its playback starts in background?
No, it can be determined also in background. But TC doesn't monitor the track progress while in background, it just reacts to the notification that the track is done to play the next track.
Author of Total Commander
https://www.ghisler.com
Post Reply