Commit 51f0806
Benjamin Moody
decoder: Avoid unnecessary locking in main decoder loop.
When decoding a large number of frames in a row, we don't need to
check for Python errors after every call to
FLAC__stream_decoder_process_single. (If an error does occur, the
read callback should cause libFLAC to abort as soon as possible.)
By moving all of the Python API calls out of the loop, we can avoid
re-acquiring the GIL or critical-section lock on every iteration.1 parent 87fe12e commit 51f0806
1 file changed
+18
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
941 | 941 | | |
942 | 942 | | |
943 | 943 | | |
944 | | - | |
| 944 | + | |
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
973 | | - | |
974 | | - | |
| 973 | + | |
975 | 974 | | |
| 975 | + | |
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | 982 | | |
988 | | - | |
| 983 | + | |
| 984 | + | |
989 | 985 | | |
| 986 | + | |
990 | 987 | | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
997 | 1000 | | |
998 | 1001 | | |
999 | 1002 | | |
| |||
0 commit comments