diff mbox series

[FFmpeg-devel,v2] avformat/mxfenc: use a zero based continuity counter

Message ID 20200229200641.6005-1-cus@passwd.hu
State Accepted
Headers show
Series [FFmpeg-devel,v2] avformat/mxfenc: use a zero based continuity counter
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Marton Balint Feb. 29, 2020, 8:06 p.m. UTC
The standard does not seem to require the counter to be zero based, but some
checker tools (MyriadBits MXFInspect, Interra Baton) have validations against 0
start...

Fixes ticket #6781.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/mxfenc.c             | 2 +-
 tests/ref/fate/mxf-user-comments | 2 +-
 tests/ref/lavf/mxf               | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Tomas Härdin March 2, 2020, 6 p.m. UTC | #1
lör 2020-02-29 klockan 21:06 +0100 skrev Marton Balint:
> The standard does not seem to require the counter to be zero based, but some
> checker tools (MyriadBits MXFInspect, Interra Baton) have validations against 0
> start...
> 
> Fixes ticket #6781.
> 
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavformat/mxfenc.c             | 2 +-
>  tests/ref/fate/mxf-user-comments | 2 +-
>  tests/ref/lavf/mxf               | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 7ea47d7311..5e0dc0e889 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -2686,7 +2686,7 @@ static void mxf_write_system_item(AVFormatContext *s)
>      avio_w8(pb, mxf->content_package_rate); // content package rate
>      avio_w8(pb, 0x00); // content package type
>      avio_wb16(pb, 0x00); // channel handle
> -    avio_wb16(pb, (mxf->tc.start + frame) & 0xFFFF); // continuity count, supposed to overflow
> +    avio_wb16(pb, frame & 0xFFFF); // continuity count, supposed to overflow

OK I suppose

/Tomas
Marton Balint March 2, 2020, 9:15 p.m. UTC | #2
On Mon, 2 Mar 2020, Tomas Härdin wrote:

> lör 2020-02-29 klockan 21:06 +0100 skrev Marton Balint:
>> The standard does not seem to require the counter to be zero based, but some
>> checker tools (MyriadBits MXFInspect, Interra Baton) have validations against 0
>> start...
>> 
>> Fixes ticket #6781.
>> 
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/mxfenc.c             | 2 +-
>>  tests/ref/fate/mxf-user-comments | 2 +-
>>  tests/ref/lavf/mxf               | 4 ++--
>>  3 files changed, 4 insertions(+), 4 deletions(-)
>> 
>> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
>> index 7ea47d7311..5e0dc0e889 100644
>> --- a/libavformat/mxfenc.c
>> +++ b/libavformat/mxfenc.c
>> @@ -2686,7 +2686,7 @@ static void mxf_write_system_item(AVFormatContext *s)
>>      avio_w8(pb, mxf->content_package_rate); // content package rate
>>      avio_w8(pb, 0x00); // content package type
>>      avio_wb16(pb, 0x00); // channel handle
>> -    avio_wb16(pb, (mxf->tc.start + frame) & 0xFFFF); // continuity count, supposed to overflow
>> +    avio_wb16(pb, frame & 0xFFFF); // continuity count, supposed to overflow
>
> OK I suppose

Thanks, applied.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 7ea47d7311..5e0dc0e889 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2686,7 +2686,7 @@  static void mxf_write_system_item(AVFormatContext *s)
     avio_w8(pb, mxf->content_package_rate); // content package rate
     avio_w8(pb, 0x00); // content package type
     avio_wb16(pb, 0x00); // channel handle
-    avio_wb16(pb, (mxf->tc.start + frame) & 0xFFFF); // continuity count, supposed to overflow
+    avio_wb16(pb, frame & 0xFFFF); // continuity count, supposed to overflow
     if (mxf->essence_container_count > 1)
         avio_write(pb, multiple_desc_ul, 16);
     else {
diff --git a/tests/ref/fate/mxf-user-comments b/tests/ref/fate/mxf-user-comments
index 4b734a0f85..e91b23baa5 100644
--- a/tests/ref/fate/mxf-user-comments
+++ b/tests/ref/fate/mxf-user-comments
@@ -1 +1 @@ 
-683bacb0105e5bc5bbf46aa430c644d1
+c6469c0ae2aaee602eacbc009080ae8e
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index 471fc5518e..5b16496f06 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,7 +1,7 @@ 
-649009e3d3d62eb3b6c56334d057cc4d *tests/data/lavf/lavf.mxf
+27b98795036b334e100c15c7e06d948f *tests/data/lavf/lavf.mxf
 526393 tests/data/lavf/lavf.mxf
 tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-9076b7015cffe8aa72883e900a2041a5 *tests/data/lavf/lavf.mxf
+783b475a818602f54e947094d57e2981 *tests/data/lavf/lavf.mxf
 561721 tests/data/lavf/lavf.mxf
 tests/data/lavf/lavf.mxf CRC=0x96ff1b48
 02bf8f0cd8951a49e277306691cb1538 *tests/data/lavf/lavf.mxf