[FFmpeg-devel] [PATCH] img2enc: remove nonsense broken code

Paul B Mahol onemda at gmail.com
Tue Nov 6 00:58:41 CET 2012


On 11/5/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Mon, Nov 05, 2012 at 11:38:18PM +0000, Paul B Mahol wrote:
>> On 11/5/12, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Mon, Nov 05, 2012 at 08:15:36PM +0000, Paul B Mahol wrote:
>> >> split_planes: this is awfull hack and if it is ever triggered it can
>> >> not work correctly for almost all image format and may cause invalid
>> >> reads.
>> >>
>> >> jp2 hack: nothing use this and this is not right place for it.
>> >> It also does not work reliably (it use filename to guess codec).
>> >>
>> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> >> ---
>> >>  libavformat/img2enc.c | 39 ---------------------------------------
>> >>  1 file changed, 39 deletions(-)
>> >>
>> >> diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
>> >> index dea4572..6d601ba 100644
>> >> --- a/libavformat/img2enc.c
>> >> +++ b/libavformat/img2enc.c
>> >> @@ -33,7 +33,6 @@ typedef struct {
>> >>      const AVClass *class;  /**< Class for private options. */
>> >>      int img_number;
>> >>      int is_pipe;
>> >> -    int split_planes;       /**< use independent file for each Y, U,
>> >> V
>> >> plane */
>> >>      char path[1024];
>> >>      int updatefirst;
>> >>  } VideoMuxData;
>> >> @@ -52,7 +51,6 @@ static int write_header(AVFormatContext *s)
>> >>          img->is_pipe = 1;
>> >>
>> >>      str = strrchr(img->path, '.');
>> >> -    img->split_planes = str && !av_strcasecmp(str + 1, "y");
>> >>      return 0;
>> >>  }
>> >>
>> >
>> > I suspect this break outputing raw yuv images into 3 seperate files
>>
>> Marginal feature which works only for some pixel formats, I can not
>> tolerate such nuisance.
>>
>> It is better to write filter for this.
>
> I am happy with any implementation that works but a simple
> file%d.y
> should work, like it does now.
>
> Can you explain what problem exists with this code and why you
> want to remove it ?
>

If non yuv420p(i guess) pix_fmt is used or codec is forced it breaks.
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> DNS cache poisoning attacks, popular search engine, Google internet
> authority
> dont be evil, please
>


More information about the ffmpeg-devel mailing list