Message ID | DB6PR0101MB2214490BF4B16AD00E14B3F38F999@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com |
---|---|
State | Accepted |
Commit | 879eed5555b2d1f185bd4998631be21b1417874e |
Headers | show |
Series | [FFmpeg-devel] avcodec/ttmlenc: Deduplicate ttml_default_namespacing string | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Fri, Jul 29, 2022 at 11:23 AM Andreas Rheinhardt <andreas.rheinhardt@outlook.com> wrote: > > String literals are allowed to be deduplicated (and toolchains > are already capable of doing so), yet the same is not allowed > for named arrays (even when they contain strings). Therefore > use a const char *const pointing to an unnamed string literal > for ttml_default_namespacing. > Reminded myself how this variable was being utilized, LGTM. Jan
diff --git a/libavcodec/ttmlenc.h b/libavcodec/ttmlenc.h index 467f35c7a6..654ca0ee4d 100644 --- a/libavcodec/ttmlenc.h +++ b/libavcodec/ttmlenc.h @@ -25,7 +25,7 @@ #define TTMLENC_EXTRADATA_SIGNATURE "lavc-ttmlenc" #define TTMLENC_EXTRADATA_SIGNATURE_SIZE (sizeof(TTMLENC_EXTRADATA_SIGNATURE) - 1) -static const char ttml_default_namespacing[] = +static const char *const ttml_default_namespacing = " xmlns=\"http://www.w3.org/ns/ttml\"\n" " xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n" " xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n"
String literals are allowed to be deduplicated (and toolchains are already capable of doing so), yet the same is not allowed for named arrays (even when they contain strings). Therefore use a const char *const pointing to an unnamed string literal for ttml_default_namespacing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/ttmlenc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)