Opened 3 years ago

Last modified 3 years ago

#2378 new defect

Flac files : Slave get_time_pos wrong

Reported by: Bertrand Florat Owned by: beastd
Priority: normal Component: undetermined
Version: 1.4 Severity: blocker
Keywords: slave flac Cc: Bertrand Florat
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description (last modified by Bertrand Florat)

Summary of the bug: When playing Flac files using slave mode, get_time_pos returns erroneous values.

Using your 1.4.0 debian package

How to reproduce:
Download this Flac sample (I reproduced against all of my own flac files I tested) :

mplayer -v 
MPlayer SVN-r38304-8 (C) 2000-2021 MPlayer Team
CPU vendor name: AuthenticAMD  max cpuid level: 13
CPU: AMD Ryzen 5 3400G with Radeon Vega Graphics     (Family: 23, Model: 8, Stepping: 1)
extended cpuid-level: 31
extended cache-info: 33579328
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNowExt: 0 SSE: 1 SSE2: 1 SSE3: 1 SSSE3: 1 SSE4: 1 SSE4.2: 1 AVX: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 CMOV
get_path('codecs.conf') -> '/home/bflorat/.mplayer/codecs.conf'
Reading optional codecs config file /home/bflorat/.mplayer/codecs.conf: No such file or directory
Reading optional codecs config file /etc/mplayer/codecs.conf: No such file or directory
Using built-in default codecs.conf.
Using SSE2 Optimized OnScreenDisplay

mplayer -quiet -slave  "Sample_BeeMoved_96kHz24bit.flac"
... some time

No issue with mp3 files I tested :


Expected : a positive value in secs
Observed : a negative value (doesn't change during the play)

Only flac format seems affected.

Strange that get_percent_pos on the other hand returns a correct value.


Change History (5)

comment:1 by Bertrand Florat, 3 years ago

Summary: Slave mode get_time_pos flac wrongFlac files : Slave get_time_pos wrong

comment:2 by Bertrand Florat, 3 years ago

Description: modified (diff)

comment:3 by reimar, 3 years ago

I don't think this happens with all flac files (not the one in our samples server for example).
Using -novideo avoids the issue.
The problem is likely the embedded image, which does not have a time stamp.
Don't know if there is a simple, always correct way to know that get_time_pos should NOT return the video time stamp but the audio time stamp.

comment:4 by reimar, 3 years ago

This works, but it's a bit of a hack and I don't know what the risk is, both breaking something or not fixing some case:

Index: command.c
--- command.c	(Revision 38313)
+++ command.c	(Arbeitskopie)
@@ -3360,7 +3360,7 @@
         case MP_CMD_GET_TIME_POS:{
                 float pos = 0;
-                if (sh_video)
+                if (sh_video && sh_video->pts != MP_NOPTS_VALUE)
                     pos = sh_video->pts;
                 else if (sh_audio && mpctx->audio_out)
                     pos =

Last edited 3 years ago by reimar (previous) (diff)

comment:5 by Bertrand Florat, 3 years ago

Thanks, I confirm -novideo fixes my issue.

Note: See TracTickets for help on using tickets.