[openbeos] Re: Solution to MediaKit sync issue resolved

  • From: "Solaja, Zenja" <solaja@xxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 30 Jun 2004 10:11:51 +1000

It seems that the issue is with decoding a BMediaTrack, and its method
DecodedFormat().  When you perform a SeekToTime(bigtime_t), it misjumps by a
factor of 1024/1000.  Also, the DecodReadFrame or ReadChunk() members of
BMediaTrack will as a consequence read 1024/1000 bytes when passing it to
BSoundPlayer. To resolve audio sync issues, all you need to do is manually
adjust bigtime_t when seeking by:

time *= 1000/1024;
SeekToTime(time);

Its the decoders responisbility to resolve variable bit rate issues - higher
level code doesn't need to know (and doesn't care).  I haven't noticed an
issue, so I'm assuming that its OK.

Also, when setting up DecodedFormat(format), adjust the frame rate by
1000/1024, and you should bypass the synchronisation issues.  Hopefully, the
Haiku MediaKit will not have this bug.

PS.David, I've never had an issue with the video portion of 3ivx (hey,its my
favourite decoder).  Appretiate your work on it :-)


-----Original Message-----
From: David McPaul [mailto:dmcpaul@xxxxxxxxxxxxxx] 
Sent: Tuesday, 29 June 2004 5:46 PM
To: openbeos@xxxxxxxxxxxxx
Subject: [openbeos] Re: Solution to MediaKit sync issue resolved


Zenja,

        Have you tested this with an AVI containing a Variable Bit Rate 
MP3?

        I can see how the problem discussed below can cause the problem 
which suggests that some/all? of the media decoders are using 1024 as 
the time divider in places or do you think it is at the media player 
code?

        I think most problems people have with AVI (where the problem is 
often reported) is because the MP3 audio they use is VBR and so it can 
be difficult to seek correctly.   Simply because 10 frames of VBR audio 
will vary depending on where you are in the track.

        The other issue is simply that the recorded audio simply cannot be 
syncronised with the video as the frame rate of each track is too 
different.

        For the record the 3ivx decoder uses 1000 as a base when seeking by 
time.

Cheers
David

----------------------------------------------------------------------
IMPORTANT NOTICES
This email (including any documents referred to in, or attached, to this
email) may contain information that is personal, confidential or the subject
of copyright or other proprietary rights in favour of Aristocrat, its
affiliates or third parties. This email is intended only for the named
addressee. Any privacy, confidence, copyright or other proprietary rights in
favour of Aristocrat, its affiliates or third parties, is not lost because
this email was sent to you by mistake.

If you received this email by mistake you should: (i) not copy, disclose,
distribute or otherwise use it, or its contents, without the consent of
Aristocrat or the owner of the relevant rights; (ii) let us know of the
mistake by reply email or by telephone (+61 2 9413 6300); and (iii) delete
it from your system and destroy all copies.

Any personal information contained in this email must be handled in
accordance with applicable privacy laws.

Electronic and internet communications can be interfered with or affected by
viruses and other defects. As a result, such communications may not be
successfully received or, if received, may cause interference with the
integrity of receiving, processing or related systems (including hardware,
software and data or information on, or using, that hardware or software).
Aristocrat gives no assurances in relation to these matters.

If you have any doubts about the veracity or integrity of any electronic
communication we appear to have sent you, please call +61 2 9413 6300 for
clarification.

Other related posts: