[FFmpeg-devel] [PATCH v2] avformat/ifv: added support for ifv cctv files

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed May 8 09:22:16 EEST 2019


On 08.05.2019, at 08:01, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:

> Am Mi., 8. Mai 2019 um 00:52 Uhr schrieb Reimar Döffinger
> <Reimar.Doeffinger at gmx.de>:
>> 
>> On 07.05.2019, at 12:00, Swaraj Hota <swarajhota353 at gmail.com> wrote:
>> 
>>> On Sun, May 05, 2019 at 09:59:01PM +0200, Reimar Döffinger wrote:
>>>> 
>>>> 
>>>>> +    /*read video index*/
>>>>> +    avio_seek(s->pb, 0xf8, SEEK_SET);
>>>> [...]
>>>>> +    avio_skip(s->pb, ifv->vid_index->frame_offset - avio_tell(s->pb));
>>>> 
>>>> Why use avio_seek in one place and avio_skip in the other?
>>>> 
>>> 
>>> No particular reason. Essentially all are just skips. There is no
>>> backward seek. I left two seeks becuase they seemed more readable.
>>> Someone could know at a glance at what offset the first video and audio
>>> index are assumed/found to be. Should I change them to skips as well?
>> 
>> Not quite sure how things work nowadays, but I'd suggest to use whichever
>> gives the most readable code.
>> Which would mean using avio_seek in this case.
> 
> I originally suggested using avio_skip() instead of avio_seek() to clarify
> that no back-seeking is involved.
> I realize it may not have been the best approach...

Well, it is good advice in principle, but in this case it seems to lead to ugly code (and it was only done in some cases).
That kind of thing tends to be hard to know before making the change.


More information about the ffmpeg-devel mailing list