[FFmpeg-devel] [PATCH 1/2] avformat/dv: allow returning damaged audio

Marton Balint cus at passwd.hu
Sun Aug 2 00:26:03 EEST 2020



On Sat, 1 Aug 2020, Michael Niedermayer wrote:

> On Sat, Aug 01, 2020 at 07:28:53PM +0200, Marton Balint wrote:
>>
>>
>> On Sat, 1 Aug 2020, Michael Niedermayer wrote:
>>
>>> Fixes: Ticket8762
>>> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
>>> ---
>>> libavformat/dv.c | 49 +++++++++++++++++++++++++++++++++++++++++-------
>>> 1 file changed, 42 insertions(+), 7 deletions(-)
>>
>> If "dv remux loses sync", then the timestamps should be fixed, not
>> additional packets should be generated based on previously read packet data
>> (which is a fragile approach to begin with, e.g. what if the first frame is
>> the corrupt one?).
>
> Ticket8762 is about stream copy, so if no packets are returned for audio
> but are for video and just timestamps are updated this would at least on
> its own probably not work that well.

If the timestamps are good, a good player should be able to play it 
correctly, even if audio stream is sparse.

None of the demuxers generate packets because the timestamps are not 
continous, I just don't think it would be consistent if DV suddenly 
started to do this. E.g. what if the user wants to drop video with no 
audio?

>
> about the case of a damaged first frame. Do you have a testcase ?

No, but it can happen, can't it? If the stream starts with no audio for 1 
second you will have 1 second A-V desync, as far as I see, that is why I 
believe fixing the timestamps is the proper fix.

Regards,
Marton


More information about the ffmpeg-devel mailing list