[FFmpeg-devel] [PATCH v2 6/6] avformat/subtitles: guess UTF-16 if no BOM present

Michael Niedermayer michaelni at gmx.at
Sat Sep 6 12:13:17 CEST 2014


On Sat, Sep 06, 2014 at 08:24:10AM +0200, Reimar Döffinger wrote:
> On 06.09.2014, at 00:23, wm4 <nfxjfg at googlemail.com> wrote:
> > On Sat, 6 Sep 2014 00:00:10 +0200
> > Michael Niedermayer <michaelni at gmx.at> wrote:
> > 
> >> On Thu, Sep 04, 2014 at 10:40:27PM +0200, wm4 wrote:
> >>> ---
> >>> Follows reimar's suggestion for detecting UTF-16. If the detection goes
> >>> wrong, probing the format won't succeed, so this should not break
> >>> anything.
> >>> 
> >> 
> >>> I didn't use ffio_ensure_seekback), because this apparently reallocates
> >>> the buffer - which we certainly don't want, because the probe API
> >>> doesn't allow this.
> >> 
> >> the format probe API doesnt provide a AVIOContext, and if one is
> >> provided, it could use a allocated and reallocatable buffer
> >> or do i misunderstand ?
> >> 
> >> [...]
> > 
> > I'm ffio_init_context() to initialize an AVIOContext on a buffer (the
> > probe buffer)
> 
> I do not know the actual behaviour for sure, but for a context based on a buffer, seekback should never ever be possible to fail...
> So if we can detect that case, I think the ensure function should behave like a NOP.

ffio_ensure_seekback() could check if AVIOContext.read_packet is set
and return success if its not

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140906/7fb89c3a/attachment.asc>


More information about the ffmpeg-devel mailing list