Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there something wrong with the hash function of mlt_properties_add? #981

Open
zxfskr opened this issue Apr 28, 2024 · 2 comments
Open
Labels

Comments

@zxfskr
Copy link

zxfskr commented Apr 28, 2024

windows10; mlt v7.22.0

Is there something wrong with the hash function of mlt_properties_add? The hashes of many names in the picture are the same, and the data using mlt_properties_get is empty.


image
image
image
image

@ddennedy
Copy link
Member

ddennedy commented Apr 28, 2024

Do not reproduce here using gcc 13 via msys2

[Debug  ] <MLT> mlt_properties_add: key 73 name: MLT_NORMALISATION
[Debug  ] <MLT> mlt_properties_add: key 130 name: MLT_PRODUCER
[Debug  ] <MLT> mlt_properties_add: key 73 name: MLT_CONSUMER
[Debug  ] <MLT> mlt_properties_add: key 34 name: MLT_TEST_CARD
[Debug  ] <MLT> mlt_properties_add: key 111 name: MLT_PROFILE
[Debug  ] <MLT> mlt_properties_add: key 146 name: MLT_DATA
[Debug  ] <MLT> mlt_properties_add: key 121 name: 8
[Debug  ] <MLT> mlt_properties_add: key 122 name: 9
[Debug  ] <MLT> mlt_properties_add: key 29 name: 10
[Debug  ] <MLT> mlt_properties_add: key 30 name: 11
[Debug  ] <MLT> mlt_properties_add: key 31 name: 12
[Debug  ] <MLT> mlt_properties_add: key 32 name: 13
[Debug  ] <MLT> mlt_properties_add: key 33 name: 14
[Debug  ] <MLT> mlt_properties_add: key 34 name: 15
[Debug  ] <MLT> mlt_properties_add: key 35 name: 16
[Debug  ] <MLT> mlt_properties_add: key 36 name: 17
[Debug  ] <MLT> mlt_properties_add: key 37 name: 18
[Debug  ] <MLT> mlt_properties_add: key 38 name: 19
[Debug  ] <MLT> mlt_properties_add: key 62 name: 20
[Debug  ] <MLT> mlt_properties_add: key 63 name: 21
[Debug  ] <MLT> mlt_properties_add: key 64 name: 22
[Debug  ] <MLT> mlt_properties_add: key 65 name: 23
[Debug  ] <MLT> mlt_properties_add: key 66 name: 24
[Debug  ] <MLT> mlt_properties_add: key 67 name: 25
[Debug  ] <MLT> mlt_properties_add: key 68 name: 26
[Debug  ] <MLT> mlt_properties_add: key 69 name: 27
[Debug  ] <MLT> mlt_properties_add: key 70 name: 28
[Debug  ] <MLT> mlt_properties_add: key 71 name: 29
[Debug  ] <MLT> mlt_properties_add: key 95 name: 30
[Debug  ] <MLT> mlt_properties_add: key 91 name: _events
[Debug  ] <MLT> mlt_properties_add: key 100 name: list:producer-create-request
[Debug  ] <MLT> mlt_properties_add: key 32 name: list:producer-create-done
[Debug  ] <MLT> mlt_properties_add: key 69 name: list:filter-create-request
[Debug  ] <MLT> mlt_properties_add: key 122 name: list:filter-create-done
[Debug  ] <MLT> mlt_properties_add: key 153 name: list:transition-create-request
[Debug  ] <MLT> mlt_properties_add: key 158 name: list:transition-create-done
[Debug  ] <MLT> mlt_properties_add: key 65 name: list:consumer-create-request
[Debug  ] <MLT> mlt_properties_add: key 139 name: list:consumer-create-done
[Debug  ] <MLT> mlt_properties_add: key 113 name: 0
[Debug  ] <MLT> mlt_properties_add: key 114 name: 1
[Debug  ] <MLT> mlt_properties_add: key 115 name: 2
[Debug  ] <MLT> mlt_properties_add: key 116 name: 3
[Debug  ] <MLT> mlt_properties_add: key 117 name: 4
[Debug  ] <MLT> mlt_properties_add: key 118 name: 5
[Debug  ] <MLT> mlt_properties_add: key 119 name: 6
[Debug  ] <MLT> mlt_properties_add: key 120 name: 7
[Debug  ] <MLT> mlt_properties_add: key 121 name: 8
[Debug  ] <MLT> mlt_properties_add: key 122 name: 9
[Debug  ] <MLT> mlt_properties_add: key 29 name: 10
[Debug  ] <MLT> mlt_properties_add: key 30 name: 11
[Debug  ] <MLT> mlt_properties_add: key 31 name: 12
[Debug  ] <MLT> mlt_properties_add: key 32 name: 13
[Debug  ] <MLT> mlt_properties_add: key 33 name: 14
[Debug  ] <MLT> mlt_properties_add: key 34 name: 15
[Debug  ] <MLT> mlt_properties_add: key 35 name: 16
[Debug  ] <MLT> mlt_properties_add: key 36 name: 17
[Debug  ] <MLT> mlt_properties_add: key 37 name: 18
[Debug  ] <MLT> mlt_properties_add: key 38 name: 19
[Debug  ] <MLT> mlt_properties_add: key 62 name: 20
[Debug  ] <MLT> mlt_properties_add: key 63 name: 21
[Debug  ] <MLT> mlt_properties_add: key 64 name: 22
[Debug  ] <MLT> mlt_properties_add: key 65 name: 23
[Debug  ] <MLT> mlt_properties_add: key 66 name: 24
[Debug  ] <MLT> mlt_properties_add: key 67 name: 25
[Debug  ] <MLT> mlt_properties_add: key 68 name: 26
[Debug  ] <MLT> mlt_properties_add: key 69 name: 27
[Debug  ] <MLT> mlt_properties_add: key 70 name: 28
[Debug  ] <MLT> mlt_properties_add: key 133 name: symbol
[Debug  ] <MLT> mlt_properties_add: key 37 name: gtkrescale
[Debug  ] <MLT> mlt_properties_add: key 133 name: symbol
[Debug  ] <MLT> mlt_properties_add: key 37 name: gtkrescale
[Debug  ] <MLT> mlt_properties_add: key 133 name: symbol
[Debug  ] <MLT> mlt_properties_add: key 91 name: pango
[Debug  ] <MLT> mlt_properties_add: key 133 name: symbol
[Debug  ] <MLT> mlt_properties_add: key 173 name: pixbuf

@bmatherly
Copy link
Member

There are only 256 possible hash keys. So the collision probability is high. That is OK and expected - which is why the find function performs a full search if the optimized hash search fails to find the correct property.

Even in Dan's example I see:

[Debug  ] <MLT> mlt_properties_add: key 37 name: 18
...
[Debug  ] <MLT> mlt_properties_add: key 37 name: gtkrescale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants