- Setting word wrapping and resizing the BTextView to the video size
before adding the text moves the subtitles to where they are supposed
to be, and breaks long lines that would be cut off.
- Show last subtitle entry: _IndexFor returns the index at which to
insert a new subtitle for some start time, so when getting an existing
one, we always need the previous index. Before the change we would do
that after checking the time of the subtitle at the returned index,
which for the times of the last one would be outside the list.
- Improve charset detection by using the whole file. Just the first line
of subtitle text may be too short to be useful, and to get there we
should have decoded the file first. The refactor also fixes not getting
the last entry from the file.
- While not subtitle related, fix typo in aspect ratio menu shortcuts.
Fixes #18151
Change-Id: I83fae735d31bce4616da9128a46be15763c30591
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7833
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
(cherry picked from commit a5df3d5221)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7856
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* use of a shared bitmap buffer in OutlineView and TitleView
* dynamically increase of the bitmap buffer after adding a column or a row
Fixes #14888
Change-Id: I4feddf636fb1446c29e60353b8f70fc084833731
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7176
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
(cherry picked from commit 94b4024f22)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7216
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
* add new field for .debug_line_str section
* implement reading string and int values tagged with DW_FORM_*
* skip new fields addressSize, segmentSelectorSize in line info header
* parse directories and file names according to new syntax
* enable line-info parsing up to version 5
Change-Id: I1dd7e0d834c73f6d72b7115c7ded9f868be84a3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6978
Reviewed-by: Rene Gollent <rene@gollent.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7049
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Differences between DWARF v3/v4 for line-info:
- added new field maxOpsPerInstruction
this new field will typically have the value of 1
unless VLIW architecture is being used
(which is not the case for Haiku)
- state machine contains a new field op_index
it has any relevance only when maxOpsPerInstruction > 1
i.e. on VLIW architectures
- added new operation DW_LNE_set_discriminator
this is already implemented in LineNumberProgram.cpp
This implementation just reads maxOpsPerInstruction and
checks that it is set to 1, which is what we expect on
all architectures currently supported by Haiku.
Change-Id: I14755d615a0e2b3a5177928c4d8f9014940a5fcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6876
Reviewed-by: Rene Gollent <rene@gollent.com>
(cherry picked from commit 3f2464f759)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7017
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Some executables (or shared objects) may have .debug_frame or
.eh_frame section which contains the CIE(/FDE) length is 0.
The DWARF spec doesn't describe this case explicitly, but doesn't
prohibit it.
LSB says to treat this a terminator of the CIE.
https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
Previous code failed to load the entire debug info of the
executable.
New code just skip these section (don't read anymore) after the
Debugger (kit) encounter a 0-length CIE.
Fixes #18438.
Change-Id: I382d0ec409d40570b5bccd384d38fa3c29ae2e7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6538
Reviewed-by: Rene Gollent <rene@gollent.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
(cherry picked from commit f0e9ed4488)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7016
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This way it will be clear why there is no line-info.
Change-Id: I2e5d0e1f90edabfde6c3f637320a82e7f988fe20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6990
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We don't need to know all the objects which have no
debug information; this just spams the console.
Change-Id: Ib0bfbf87f6d7076504ad70ba96ce646bf8c7a6de
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6989
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
I am not sure how this path could be hit besides having
O_APPEND set on a socket, which appears to be possible,
though I don't know what purpose that would serve.
Tested by adding these two lines between the sleep() and close()
in the in-tree tcp_connection_test:
fcntl(fd, F_SETFL, O_APPEND);
write(fd, "Hello", 5);
Before this commit, the above lines cause a KDL.
May fix #18133, but I don't presently have access to the
reproduction setup described in that ticket.
Remove ConstrainClippingRegion calls as they do not take into account
view transformations.
Clip drawing to the drawing rect, not the updated area.
Part of #12890
Change-Id: Icbc07f5431cf8ee826f28e6d5683135d1171d75a
(cherry picked from commit cd6e756df5)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6408
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Remove ConstrainClippingRegion calls as they do not take into
account view transformations.
Clip drawing to the drawing rect, not the updated area.
Fixes #12890
Change-Id: Ie76cb83e0af03213008da78407de25261daea5df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4457
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit e6a598a2f4)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6340
The condition variable that the load_image'ing thread is waiting on
is also owned by that same thread, so as soon as it wakes up, it
will soon return, thus destroying it. Under high load or other unlucky
scheduling conditions, it seems this could occur before the other thread
had even returned from the condition variable's NotifyAll.
Since team->loading_info is protected by the team lock, simply
acquire the team lock once more after being awoken and returning,
to synchronize and prevent this race.
Should fix #18352.
Change-Id: Ibabda436ffd07149c2012e6c797ff0c0933aebe3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6317
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
The address of the variable should be taken instead of the
variable itself being casted to `void*`.
This fixes a rare segfault bug when any Haiku binary runs in
a `chroot`ed environment without a `/dev` mount.
Change-Id: I2fdacac62fadbcce8006bbf0a5350f6ec95133ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6377
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
(cherry picked from commit 7bfc9c6fc7)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6338
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
We need to store the isGlobal value, so that the destructor
can take care of unsetting the glibc locale properly.
It seems this has been broken since d338200e2b.
Fixes #18344 and probably #18336.
Change-Id: Idb9b33cd1416969e01b73012de059ff051b76e74
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6373
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
tcp_segment_header.advertised_window is 16 bits.
Previously, instead of using the maximum window, zero would be sent, thus
the partner wouldn't send anything.
fix #18337
Change-Id: Ibff98ee58b84bdf52527a7821648a5faf20c5589
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6359
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
(cherry picked from commit 7c58a5a3fb)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6339
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The current version expects the first box to be exactly 32 bytes, but some
files found in the wild only have 28 bytes, so we now ignore the first four
bytes and it works.
Change-Id: I4c304bd6385bffd15f4adbb99cbf464f9767f7bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6302
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6320
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
BitmapStream creates a BBitmap without specifying a bytes per row, but
then check the bytes per row matches the header. It is better to ask
BBitmap for the desired bytes per row to avoid any difference in
padding.
Change-Id: Ie1facfd423ad888a14757a0fffc9e8cdf72ef832
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6301
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6319
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
The code is endian-dependant because the alpha channel is not at the
same place. This resulted in transparent white in icons being converted
to partially transparent yellow when attempting to darken the icons, for
example.
Change-Id: I57916139ba37b8d7ae0f9e9ba9e74c1d496d7b05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6077
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit 3cc1da2b77)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6096
* Added APIs for file and memory font loading that return B_NOT_SUPPORTED
when called, as requested in #16101 for forwards-compatibility with
r1beta5.
* changed uint32 size and offset arguments to size_t
Change-Id: I3dc39c233c00c05a34439e7d02cf2a4e41b97e63
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6004
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
The function returns a positive nonzero value when it works.
Change-Id: Ib5852ec1d71e44b67309f3b955b888708f2ba1cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6020
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
ffmpeg API reference does not allow to allocate AVFrame on the stack,
and especially not without initializing anything in the frame. Calling
av_frame_unref then attempts to free some non-existing data, and
crashes.
The code for video was already using a correctly allocated frame, which
we can reuse here.
Fixes #17415
Probably fixes #16831
Change-Id: I91054dc41f0a91be9c585ec927e77bfc874a37ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6019
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Solves some insecure permission errors with
sshd subprocesses.
* More secure I guess not letting "anyone" write to /
Change-Id: I1bb31ff0142585639369f7b3d15cf9a2d5755598
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5962
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
(cherry picked from commit 151482229c)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5927
Just like the one for HTML, we have to do a bit of guessing since there
is no easy structure. We can extend it with more keyowrds or remove some
if we find some problems with other files.
Tested so far with the Be Book and Haiku user guide CSS files.
Fixes #18144.
Change-Id: If04fba18846d17ba0eb28dd0bd12787f1fe32028
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5948
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Máximo Castañeda <antiswen@yahoo.es>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: nephele <nep@packageloss.eu>
(cherry picked from commit 4562b1727c)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5926
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The _Setup method can be called several times if the parameters are
changed (for example when calling SetQuality). But it always allocated a
new context without freeinthe previous one, resulting in a leak.
Part of #9458, it fixes the largest leak there (10K bytes for each loop
of the provided test) but there are other leaks left as well, some of
which apparently need an update to a newer ffmpeg version removing some
deprecated fields.
Change-Id: Iad119dbda9cff1ce023b602a1978b100a1263f7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5953
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit beff8fa729)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5925
This work-arounds the issue of the VirtualMemory preflet showing
RAM FS volumes as valid storage options for the swap file.
Removing B_FS_IS_PERSISTENT didn't work as I originally expected,
causing problems when attempting to write/delete entries on RAMFS
mounts after that.
Kudos to waddlesplash for the B_FS_IS_REMOVABLE alternative.
Change-Id: Id5ba1fa192b63b944cf59413a7f580ebb608e50d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5911
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit 1cae9edcc7)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5920
* aborted transfers will release the notify semaphore when the cancel is notified.
* the allocated buffer would be freed on return, while the usb stack eventually copied
data in the buffer in our back, leading to KDL crashes, because the freed buffer would
be right reallocated for some kernel team structures.
* regression introduced by hrev55806, the transfers didn't need to be cancelled before.
Change-Id: Ifb6e941f71d05c37c36f878059c33883bb72a67c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5905
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
(cherry picked from commit 76ddb69a3a)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5919
On 32bit x86 gcc11, allocations should be aligned to 16 bytes, but the
block header (which is stored before the allocations) contains two
pointers, which on a 32bit system results in 8 bytes. Add some padding
to make this header 16 bytes, guaranteeing that the data area is
actually aligned.
Fixes #18111.
Change-Id: Id23f8c0272d75090710f872b728852cd0fcb19ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5916
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This makes sure that apps get access to these variables regardless if
they are started from a shell or from GUI (double-click from Tracker,
desklink, etc).
Fixes #18130.
Change-Id: I82e2884e460fad7d6ec16e7b624c5cd2fcf807df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5897
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
(cherry picked from commit 3af8011358)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5918
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We need O_CLOEXEC here, not FD_CLOEXEC (which is equal to 0x1, which
in openflags is O_WRONLY and thus leads to the conflicts caught by
the previous commit.)
Fixes haikuports/haikuports#7524.