Changes between Initial Version and Version 1 of Ticket #10465, comment 3


Ignore:
Timestamp:
Oct 10, 2023, 7:54:00 AM (3 years ago)
Author:
Sergey

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10465, comment 3

    initial v1  
    1 I think I've found the reason. And it's very simple, even if audio stream has constant `packet_size` for all containing packets, it's almost always the last one is incomplete (i.e. less than `packet_size`) since there is no enough audio data to fill it completely, and it leads to wrong calculations. And it's possible using of `(caf->packets - 1)` in `packet_size` calculations was try to fix it. But for complete fix it's required to subtract duration of the last packet from full audio stream duration.
     1I think I've found the reason. And it's very simple, even if audio stream has constant `packet_size` for all containing packets, it's almost always the last one is incomplete (i.e. less than `packet_size`) since there is no enough audio data to fill it completely, and it leads to wrong calculations. And it's possible using of `(caf->packets - 1)` in `packet_size` calculations was try to fix it. But for complete fix it's required to subtract duration of the last (incomplete) packet from full audio stream duration.
    22
    33Also, maybe, it worth put calculation of duration directly to `cafenc.c` (if be more specific into `caf_write_packet` function) - it will give more control over calculations.