[Ffmpeg-devel] Patch: wav decoder eof handling

Michael Niedermayer michaelni
Tue Jun 27 21:22:40 CEST 2006


Hi

On Tue, Jun 27, 2006 at 06:46:39PM +0200, Ulrich von Zadow wrote:
[...]

> --- ffmpeg_orig/libavformat/wav.c       2006-06-27 12:35:09.000000000 +0200
> +++ ffmpeg/libavformat/wav.c    2006-06-27 16:18:02.000000000 +0200
> @@ -19,6 +19,11 @@
>  #include "avformat.h"
>  #include "avi.h"
>  
> +typedef struct {
> +    int wave_chunk_start;

should be int64_t / uint64_t to avoid a 2gb limit on the file


[...]
> -} WAVContext;
> +} WAVOContext;

such "cosmetic" renaming should be done in a seperate patch (see 
http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC34)


[...]
> @@ -331,6 +336,9 @@
>      size = find_tag(pb, MKTAG('d', 'a', 't', 'a'));
>      if (size < 0)
>          return -1;
> +    WAVIContext * wav_context = (WAVIContext*)s->priv_data;

mixing statements and declarations breaks gcc 2.95
(see http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC33)


[...]

>      AVStream *st;
>  
> +    WAVIContext * wav_context = (WAVIContext*)s->priv_data;
> +    int64_t bytes_to_read = s->data_offset+(int64_t)(wav_context->wave_chunk_len)-url_ftell(&s->pb);
> +    if (bytes_to_read <= 0) {

this ignores wave_chunk_start and as such wont work

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list