[FFmpeg-devel] [PATCH 2/3] lavc: fix recoded subtitles end.

Nicolas George nicolas.george at normalesup.org
Sun Apr 7 13:15:21 CEST 2013

L'octidi 18 germinal, an CCXXI, Clement Boesch a écrit :
> Wouldn't if (outl) outpkt->data[outpkt->size] = '\0' enough to fix the
> problem? The memset looks overkill. (note: if !outl, the zeroed padding
> takes care of the ending).

The API mandates zeroed padding at the end of the packet, as you say, the
memset is there exactly for that.

The memset could be FFMIN(outl, FF_INPUT_BUFFER_PADDING_SIZE), or even
FF_INPUT_BUFFER_PADDING_SIZE alone, but I find this version more elegant,
and the efficiency difference is irrelevant after calls to iconv.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130407/bdafcf32/attachment.asc>

More information about the ffmpeg-devel mailing list