diff mbox series

[FFmpeg-devel,v1,1/1] TEST Committing ref files with mixed EOL, marked as binary

Message ID BN0P223MB0358900908A4B2A6A37C3296BA769@BN0P223MB0358.NAMP223.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,v1,1/1] TEST Committing ref files with mixed EOL, marked as binary | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 fail Make failed
andriy/commit_msg_ppc warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_ppc fail Make failed

Commit Message

Soft Works Dec. 15, 2021, 12:03 a.m. UTC
This commit couldn't be applied due to mixed line endings in
the ref files.
For this test, I have added a .gitattributes file, marking
these as binary (-diff)

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavcodec/ass_split.c           |   7 +++++++
 tests/ref/fate/.gitattributes    |   3 +++
 tests/ref/fate/mov-mp4-ttml-dfxp |   8 ++++----
 tests/ref/fate/mov-mp4-ttml-stpp |   8 ++++----
 tests/ref/fate/sub-textenc       | Bin 4635 -> 4602 bytes
 tests/ref/fate/sub-ttmlenc       | Bin 7866 -> 7833 bytes
 tests/ref/fate/sub-webvttenc     | Bin 4323 -> 4290 bytes
 7 files changed, 18 insertions(+), 8 deletions(-)
 create mode 100644 tests/ref/fate/.gitattributes

diff --git a/tests/ref/fate/sub-textenc b/tests/ref/fate/sub-textenc
index 3ea56b38f014d0dae3857ed2534c1b9e7d027ea1..910ca3d6e3ebdcc8e652e19fbf686a86f70f368f 100644
GIT binary patch
delta 149
zcmbQO@=JL`Ca<SLPG(-JLV0FRjzV5)S!$6&Qc-GRwnAcQNq%l(NoI0lPEMslQD%BZ
zi9%9pT7FTgLVl4#Vp<7MWuihxVo{1haY15os-D8+{k$5i3Lr4~BkvqIt8%gce>Rl2
jmS1x6JpO0_uqsDhE>nfP{G!~%oXPk3r8a8_d}agyLL@NN

delta 178
zcmeyRJX>W$CU0y^Mowm4YD`9XW=>8_MqX-JYEeu^Qc-GRc1%WMX-R%=Vo7FlVopwF
zOh!>=dPWIQGBqu~2&f|;s4y|D1f)JOCL<%UC?zJNxF9h(RWByPO4o&p%h+)8Iv%mf
o=XtrgVlrTGasyxG<On`xRG}xx+=={>lbiUXk%Trs;+J3o05}9f%m4rY

diff --git a/tests/ref/fate/sub-ttmlenc b/tests/ref/fate/sub-ttmlenc
index 4df8f8796f58015d76ae184a8c99e4c4c4ab1475..aea09bb31e2ec581bd31d288fc4dceece32f5268 100644
GIT binary patch
delta 135
zcmdmGJJWW<U2z|UoXosbh4Rdt9EH5pveY7lq@vWsY=y+qlKkAnlFa19oSaI9qRjM+
z5{0DHwEUt}h5RCg#IzEi%0z{X#G(|1;)2BFR6PYNU6;uh#hfQsN~p0afWYLH5|81m
YhRI@58=<_5QniyCq`5c8Nyjh)01$93`2YX_

delta 175
zcmbPfyUTXNUGd16jGWB8)R>I&%$%H<jJ(vc)S{S-q@vWs?3j$i(vtk##FEV9#GIVU
zn2e&#^o$aqWNKP|5l}}yP+?+P2}pfnOh!gxQA$ikaY15os$NWnm9ER=i(<}`b0pNb
pVlrTGa=m23WO2!4B%#gql7@^({K*fbWF}vfN<<RcY%ZO|3;_JQLf8NR

diff --git a/tests/ref/fate/sub-webvttenc b/tests/ref/fate/sub-webvttenc
index 45ae0b6131b66d45043774b3d4a8bbfc076b267a..f4172dcc84e8d2e70f446351531be91dd4b9b106 100644
GIT binary patch
delta 128
zcmaE?ct~+W8;_?#PG(-JLV0FRjzV5)S!$6&Qc-GRwnAcQNq%l(NoI0lPEMslQD%BZ
zi9%9pT7FTgLVl4#Vp<7MWuihxVo{1haY15os-D8+J3Ml%3Lr3fK5xb38eT~_?>dy#
Qz*jg~o}Yd5U%qFI0GnznSO5S3

delta 163
zcmX@4_*ij68&6nFMowm4YD`9XW=>8_MqX-JYEeu^Qc-GRc1%WMX-R%=Vo7FlVopwF
zOh!>=dPWIQGBqu~2&f|;s4y|D1f)JOCL<%UC?zJNxF9h(RWBxE@_8OPu9yrMoZP`%
YF*%D@5>@CrGB<^<5Q)3_7T*g-0PG<@@Bjb+

Comments

Soft Works Dec. 15, 2021, 12:18 a.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Soft Works
> Sent: Wednesday, December 15, 2021 1:04 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v1 1/1] TEST Committing ref files with mixed
> EOL, marked as binary
> 
> This commit couldn't be applied due to mixed line endings in
> the ref files.
> For this test, I have added a .gitattributes file, marking
> these as binary (-diff)
> 
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
>  libavcodec/ass_split.c           |   7 +++++++
>  tests/ref/fate/.gitattributes    |   3 +++
>  tests/ref/fate/mov-mp4-ttml-dfxp |   8 ++++----
>  tests/ref/fate/mov-mp4-ttml-stpp |   8 ++++----
>  tests/ref/fate/sub-textenc       | Bin 4635 -> 4602 bytes
>  tests/ref/fate/sub-ttmlenc       | Bin 7866 -> 7833 bytes
>  tests/ref/fate/sub-webvttenc     | Bin 4323 -> 4290 bytes
>  7 files changed, 18 insertions(+), 8 deletions(-)
>  create mode 100644 tests/ref/fate/.gitattributes
> 
> diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
> index 05c5453e53..4155592954 100644
> --- a/libavcodec/ass_split.c
> +++ b/libavcodec/ass_split.c
> @@ -484,6 +484,7 @@ int ff_ass_split_override_codes(const ASSCodesCallbacks
> *callbacks, void *priv,
>      while (buf && *buf) {
>          if (text && callbacks->text &&
>              (sscanf(buf, "\\%1[nN]", new_line) == 1 ||
> +             sscanf(buf, "\\%1[hH]", new_line) == 1 ||
>               !strncmp(buf, "{\\", 2))) {
>              callbacks->text(priv, text, text_len);
>              text = NULL;
> @@ -492,6 +493,12 @@ int ff_ass_split_override_codes(const ASSCodesCallbacks
> *callbacks, void *priv,
>              if (callbacks->new_line)
>                  callbacks->new_line(priv, new_line[0] == 'N');
>              buf += 2;
> +        } else if (sscanf(buf, "\\%1[hH]", new_line) == 1) {
> +            if (callbacks->hard_space)
> +                callbacks->hard_space(priv);
> +            else if (callbacks->text)
> +                callbacks->text(priv, " ", 1);
> +            buf += 2;
>          } else if (!strncmp(buf, "{\\", 2)) {
>              buf++;
>              while (*buf == '\\') {
> diff --git a/tests/ref/fate/.gitattributes b/tests/ref/fate/.gitattributes
> new file mode 100644
> index 0000000000..19be64d085
> --- /dev/null
> +++ b/tests/ref/fate/.gitattributes
> @@ -0,0 +1,3 @@
> +sub-textenc -diff
> +sub-ttmlenc -diff
> +sub-webvttenc -diff
> diff --git a/tests/ref/fate/mov-mp4-ttml-dfxp b/tests/ref/fate/mov-mp4-ttml-
> dfxp
> index e24b5d618b..e565ffa1f6 100644
> --- a/tests/ref/fate/mov-mp4-ttml-dfxp
> +++ b/tests/ref/fate/mov-mp4-ttml-dfxp
> @@ -1,9 +1,9 @@
> -2e7e01c821c111466e7a2844826b7f6d *tests/data/fate/mov-mp4-ttml-dfxp.mp4
> -8519 tests/data/fate/mov-mp4-ttml-dfxp.mp4
> +658884e1b789e75c454b25bdf71283c9 *tests/data/fate/mov-mp4-ttml-dfxp.mp4
> +8486 tests/data/fate/mov-mp4-ttml-dfxp.mp4
>  #tb 0: 1/1000
>  #media_type 0: data
>  #codec_id 0: none
> -0,          0,          0,    68500,     7866, 0x456c36b7
> +0,          0,          0,    68500,     7833, 0x31b22193
>  {
>      "packets": [
>          {
> @@ -15,7 +15,7 @@
>              "dts_time": "0.000000",
>              "duration": 68500,
>              "duration_time": "68.500000",
> -            "size": "7866",
> +            "size": "7833",
>              "pos": "44",
>              "flags": "K_"
>          }
> diff --git a/tests/ref/fate/mov-mp4-ttml-stpp b/tests/ref/fate/mov-mp4-ttml-
> stpp
> index 77bd23b7bf..f25b5b2d28 100644
> --- a/tests/ref/fate/mov-mp4-ttml-stpp
> +++ b/tests/ref/fate/mov-mp4-ttml-stpp
> @@ -1,9 +1,9 @@
> -cbd2c7ff864a663b0d893deac5a0caec *tests/data/fate/mov-mp4-ttml-stpp.mp4
> -8547 tests/data/fate/mov-mp4-ttml-stpp.mp4
> +c9570de0ccebc858b0c662a7e449582c *tests/data/fate/mov-mp4-ttml-stpp.mp4
> +8514 tests/data/fate/mov-mp4-ttml-stpp.mp4
>  #tb 0: 1/1000
>  #media_type 0: data
>  #codec_id 0: none
> -0,          0,          0,    68500,     7866, 0x456c36b7
> +0,          0,          0,    68500,     7833, 0x31b22193
>  {
>      "packets": [
>          {
> @@ -15,7 +15,7 @@ cbd2c7ff864a663b0d893deac5a0caec *tests/data/fate/mov-mp4-
> ttml-stpp.mp4
>              "dts_time": "0.000000",
>              "duration": 68500,
>              "duration_time": "68.500000",
> -            "size": "7866",
> +            "size": "7833",
>              "pos": "44",
>              "flags": "K_"
>          }
> diff --git a/tests/ref/fate/sub-textenc b/tests/ref/fate/sub-textenc
> index
> 3ea56b38f014d0dae3857ed2534c1b9e7d027ea1..910ca3d6e3ebdcc8e652e19fbf686a86f70
> f368f 100644
> GIT binary patch
> delta 149
> zcmbQO@=JL`Ca<SLPG(-JLV0FRjzV5)S!$6&Qc-GRwnAcQNq%l(NoI0lPEMslQD%BZ
> zi9%9pT7FTgLVl4#Vp<7MWuihxVo{1haY15os-D8+{k$5i3Lr4~BkvqIt8%gce>Rl2
> jmS1x6JpO0_uqsDhE>nfP{G!~%oXPk3r8a8_d}agyLL@NN
> 
> delta 178
> zcmeyRJX>W$CU0y^Mowm4YD`9XW=>8_MqX-JYEeu^Qc-GRc1%WMX-R%=Vo7FlVopwF
> zOh!>=dPWIQGBqu~2&f|;s4y|D1f)JOCL<%UC?zJNxF9h(RWByPO4o&p%h+)8Iv%mf
> o=XtrgVlrTGasyxG<On`xRG}xx+=={>lbiUXk%Trs;+J3o05}9f%m4rY
> 
> diff --git a/tests/ref/fate/sub-ttmlenc b/tests/ref/fate/sub-ttmlenc
> index
> 4df8f8796f58015d76ae184a8c99e4c4c4ab1475..aea09bb31e2ec581bd31d288fc4dceece32
> f5268 100644
> GIT binary patch
> delta 135
> zcmdmGJJWW<U2z|UoXosbh4Rdt9EH5pveY7lq@vWsY=y+qlKkAnlFa19oSaI9qRjM+
> z5{0DHwEUt}h5RCg#IzEi%0z{X#G(|1;)2BFR6PYNU6;uh#hfQsN~p0afWYLH5|81m
> YhRI@58=<_5QniyCq`5c8Nyjh)01$93`2YX_
> 
> delta 175
> zcmbPfyUTXNUGd16jGWB8)R>I&%$%H<jJ(vc)S{S-q@vWs?3j$i(vtk##FEV9#GIVU
> zn2e&#^o$aqWNKP|5l}}yP+?+P2}pfnOh!gxQA$ikaY15os$NWnm9ER=i(<}`b0pNb
> pVlrTGa=m23WO2!4B%#gql7@^({K*fbWF}vfN<<RcY%ZO|3;_JQLf8NR
> 
> diff --git a/tests/ref/fate/sub-webvttenc b/tests/ref/fate/sub-webvttenc
> index
> 45ae0b6131b66d45043774b3d4a8bbfc076b267a..f4172dcc84e8d2e70f446351531be91dd4b
> 9b106 100644
> GIT binary patch
> delta 128
> zcmaE?ct~+W8;_?#PG(-JLV0FRjzV5)S!$6&Qc-GRwnAcQNq%l(NoI0lPEMslQD%BZ
> zi9%9pT7FTgLVl4#Vp<7MWuihxVo{1haY15os-D8+J3Ml%3Lr3fK5xb38eT~_?>dy#
> Qz*jg~o}Yd5U%qFI0GnznSO5S3
> 
> delta 163
> zcmX@4_*ij68&6nFMowm4YD`9XW=>8_MqX-JYEeu^Qc-GRc1%WMX-R%=Vo7FlVopwF
> zOh!>=dPWIQGBqu~2&f|;s4y|D1f)JOCL<%UC?zJNxF9h(RWBxE@_8OPu9yrMoZP`%
> YF*%D@5>@CrGB<^<5Q)3_7T*g-0PG<@@Bjb+
> 
> --

OK, that worked!
(the failing build was expected)

I wonder whether it might make sense to mark all ref files like this
to avoid such problems in the future?
i.e.:

---
* -diff
---

in the .gitattributes file..?

softworkz
diff mbox series

Patch

diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
index 05c5453e53..4155592954 100644
--- a/libavcodec/ass_split.c
+++ b/libavcodec/ass_split.c
@@ -484,6 +484,7 @@  int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv,
     while (buf && *buf) {
         if (text && callbacks->text &&
             (sscanf(buf, "\\%1[nN]", new_line) == 1 ||
+             sscanf(buf, "\\%1[hH]", new_line) == 1 ||
              !strncmp(buf, "{\\", 2))) {
             callbacks->text(priv, text, text_len);
             text = NULL;
@@ -492,6 +493,12 @@  int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv,
             if (callbacks->new_line)
                 callbacks->new_line(priv, new_line[0] == 'N');
             buf += 2;
+        } else if (sscanf(buf, "\\%1[hH]", new_line) == 1) {
+            if (callbacks->hard_space)
+                callbacks->hard_space(priv);
+            else if (callbacks->text)
+                callbacks->text(priv, " ", 1);
+            buf += 2;
         } else if (!strncmp(buf, "{\\", 2)) {
             buf++;
             while (*buf == '\\') {
diff --git a/tests/ref/fate/.gitattributes b/tests/ref/fate/.gitattributes
new file mode 100644
index 0000000000..19be64d085
--- /dev/null
+++ b/tests/ref/fate/.gitattributes
@@ -0,0 +1,3 @@ 
+sub-textenc -diff
+sub-ttmlenc -diff
+sub-webvttenc -diff
diff --git a/tests/ref/fate/mov-mp4-ttml-dfxp b/tests/ref/fate/mov-mp4-ttml-dfxp
index e24b5d618b..e565ffa1f6 100644
--- a/tests/ref/fate/mov-mp4-ttml-dfxp
+++ b/tests/ref/fate/mov-mp4-ttml-dfxp
@@ -1,9 +1,9 @@ 
-2e7e01c821c111466e7a2844826b7f6d *tests/data/fate/mov-mp4-ttml-dfxp.mp4
-8519 tests/data/fate/mov-mp4-ttml-dfxp.mp4
+658884e1b789e75c454b25bdf71283c9 *tests/data/fate/mov-mp4-ttml-dfxp.mp4
+8486 tests/data/fate/mov-mp4-ttml-dfxp.mp4
 #tb 0: 1/1000
 #media_type 0: data
 #codec_id 0: none
-0,          0,          0,    68500,     7866, 0x456c36b7
+0,          0,          0,    68500,     7833, 0x31b22193
 {
     "packets": [
         {
@@ -15,7 +15,7 @@ 
             "dts_time": "0.000000",
             "duration": 68500,
             "duration_time": "68.500000",
-            "size": "7866",
+            "size": "7833",
             "pos": "44",
             "flags": "K_"
         }
diff --git a/tests/ref/fate/mov-mp4-ttml-stpp b/tests/ref/fate/mov-mp4-ttml-stpp
index 77bd23b7bf..f25b5b2d28 100644
--- a/tests/ref/fate/mov-mp4-ttml-stpp
+++ b/tests/ref/fate/mov-mp4-ttml-stpp
@@ -1,9 +1,9 @@ 
-cbd2c7ff864a663b0d893deac5a0caec *tests/data/fate/mov-mp4-ttml-stpp.mp4
-8547 tests/data/fate/mov-mp4-ttml-stpp.mp4
+c9570de0ccebc858b0c662a7e449582c *tests/data/fate/mov-mp4-ttml-stpp.mp4
+8514 tests/data/fate/mov-mp4-ttml-stpp.mp4
 #tb 0: 1/1000
 #media_type 0: data
 #codec_id 0: none
-0,          0,          0,    68500,     7866, 0x456c36b7
+0,          0,          0,    68500,     7833, 0x31b22193
 {
     "packets": [
         {
@@ -15,7 +15,7 @@  cbd2c7ff864a663b0d893deac5a0caec *tests/data/fate/mov-mp4-ttml-stpp.mp4
             "dts_time": "0.000000",
             "duration": 68500,
             "duration_time": "68.500000",
-            "size": "7866",
+            "size": "7833",
             "pos": "44",
             "flags": "K_"
         }