Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-19 Thread Kevin Wheatley
V3 of the patch, I've attempted to include the general comments from the thread. New to this version, I've reworked the function that reads the atom into the extradata into one which calls 2 helper functions (one to realloc, one to read), I've then reused these functions to read the ACLR atom

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-18 Thread Kevin Wheatley
So reading through the comments in this thread, it looks to me like some of the problems come from the use of the mov_read_extradata() function, which has more logic than the name implies, in particular it will successfully return even if it did not read the atom into the extradata, so if i just

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-18 Thread Michael Niedermayer
On Wed, Feb 18, 2015 at 09:40:24AM +, Kevin Wheatley wrote: So reading through the comments in this thread, it looks to me like some of the problems come from the use of the mov_read_extradata() function, which has more logic than the name implies, in particular it will successfully return

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread Michael Niedermayer
On Tue, Feb 17, 2015 at 01:52:19PM +0100, wm4 wrote: On Tue, 17 Feb 2015 12:40:52 + Kevin Wheatley kevin.j.wheat...@gmail.com wrote: On Tue, Feb 17, 2015 at 12:25 PM, Michael Niedermayer michae...@gmx.at wrote: if the codec id doesnt match the expected, mov_read_extradata will

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread Michael Niedermayer
On Tue, Feb 17, 2015 at 12:40:52PM +, Kevin Wheatley wrote: On Tue, Feb 17, 2015 at 12:25 PM, Michael Niedermayer michae...@gmx.at wrote: if the codec id doesnt match the expected, mov_read_extradata will return 0 even without any truncation. In this case the error message would be

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread Kevin Wheatley
Oops, I missed that when I allowed the atom to be added to the end of the extradata, updated. I'm not sure if logging as an error is appropriate in the case when the extradata is not large enough, for this to occur the file will have been truncated somehow and the mov_read_extradata function will

[FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread Kevin Wheatley
Add simple ACLR atom reading to set the color range of the incomming track for codec's like DNxHD that utilise AVID's proprietary atom. Note: for this to work with ffmpeg generated DNxHD QuickTime files you need to also use my other patch to prevent ffmpeg generating 'corrupt' files. From

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread Michael Niedermayer
On Tue, Feb 17, 2015 at 09:20:23AM +, Kevin Wheatley wrote: Add simple ACLR atom reading to set the color range of the incomming track for codec's like DNxHD that utilise AVID's proprietary atom. Note: for this to work with ffmpeg generated DNxHD QuickTime files you need to also use my

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread Michael Niedermayer
On Tue, Feb 17, 2015 at 11:58:06AM +, Kevin Wheatley wrote: Oops, I missed that when I allowed the atom to be added to the end of the extradata, updated. I'm not sure if logging as an error is appropriate in the case when the extradata is not large enough, for this to occur the file will

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread wm4
On Tue, 17 Feb 2015 12:40:52 + Kevin Wheatley kevin.j.wheat...@gmail.com wrote: On Tue, Feb 17, 2015 at 12:25 PM, Michael Niedermayer michae...@gmx.at wrote: if the codec id doesnt match the expected, mov_read_extradata will return 0 even without any truncation. In this case the

Re: [FFmpeg-devel] [PATCH] avformat: Add simple ACLR atom reading to set the color range

2015-02-17 Thread Kevin Wheatley
On Tue, Feb 17, 2015 at 12:25 PM, Michael Niedermayer michae...@gmx.at wrote: if the codec id doesnt match the expected, mov_read_extradata will return 0 even without any truncation. In this case the error message would be incorrect So should I code the test against codec id against the files