[FFmpeg-devel] [PATCH] pulse: set default frame_size to 4608
federico.simoncelli at gmail.com
Sat Jan 4 10:01:39 CET 2014
On Sat, Jan 4, 2014 at 5:03 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, Jan 04, 2014 at 01:01:12AM +0100, Federico Simoncelli wrote:
>> On Fri, Jan 3, 2014 at 6:41 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> I just found out that this may be related to the side data:
>> [mp3 @ 0x191e320] skip 1105 samples due to side data
>> [mp3 @ 0x191e320] skip 1105/1152 samples
>> > frame_pts = 1105, frame_ts = 0.023021, base_ts = 0.000021
>> > frame_pts = 1152, frame_ts = 0.024000, base_ts = 0.000021
>> > frame_pts = 2304, frame_ts = 0.048000, base_ts = 0.000021
>> > frame_pts = 3456, frame_ts = 0.072000, base_ts = 0.000021
>> There's one thing that is not clear to me, if the side data are frames
>> to be discarded, why is the pts adjusted?
> side data is "attached" to normal packets which contain normal data
> A encoder might add side data that for example says "dear decoder
> if you decode this packet, discard the first 1000 samples, they
> are just some kind of padding and the actual audio starts after that"
Ok, that's what I thought, and therefore I don't think that the pts
should be adjusted.
For example, in input you have nb_samples = 1024:
[ frame0 - frame1023 ] [ frame1024 - frame2047 ] ...
now the encoder adds 1105 frames of side data and changes nb_samples to 1152:
[ side data 1105 frames ] [ frame0 - frame46 ] [ frame47 - frame1198 ] ...
currently what avcodec_decode_audio4 does is discarding the side data
but then adjusting the pts as if they were regular playable frames,
and in fact frame0 is shifted to 0.023s (in my case), while in the
original it's at 0.000s.
More information about the ffmpeg-devel