[FFmpeg-devel] [PATCH 1/2] ffmenc: use ffio_fill()

Michael Niedermayer michaelni at gmx.at
Tue Jul 16 01:19:34 CEST 2013


On Mon, Jul 15, 2013 at 08:27:41PM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavformat/ffmenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
> index eb809eb..41f148e 100644
> --- a/libavformat/ffmenc.c
> +++ b/libavformat/ffmenc.c
> @@ -24,6 +24,7 @@
>  #include "libavutil/avassert.h"
>  #include "libavutil/parseutils.h"
>  #include "avformat.h"
> +#include "avio_internal.h"
>  #include "internal.h"
>  #include "ffm.h"
>  
> @@ -213,8 +214,7 @@ static int ffm_write_header(AVFormatContext *s)
>      avio_wb64(pb, 0); // end of header
>  
>      /* flush until end of block reached */
> -    while ((avio_tell(pb) % ffm->packet_size) != 0)
> -        avio_w8(pb, 0);
> +    ffio_fill(pb, 0, ffm->packet_size - avio_tell(pb));

this is not the same as the code before

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- 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/20130716/b46e2289/attachment.asc>


More information about the ffmpeg-devel mailing list