Compare commits
3 Commits
readme-fed
...
packet_ref
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
886781e115 | ||
|
|
d8c2fe6ef2 | ||
|
|
54c7baceac |
@@ -95,29 +95,27 @@ sc_demuxer_push_packet(struct sc_demuxer *demuxer, AVPacket *packet) {
|
|||||||
// A config packet must not be decoded immediately (it contains no
|
// A config packet must not be decoded immediately (it contains no
|
||||||
// frame); instead, it must be concatenated with the future data packet.
|
// frame); instead, it must be concatenated with the future data packet.
|
||||||
if (demuxer->pending || is_config) {
|
if (demuxer->pending || is_config) {
|
||||||
size_t offset;
|
|
||||||
if (demuxer->pending) {
|
if (demuxer->pending) {
|
||||||
offset = demuxer->pending->size;
|
size_t offset = demuxer->pending->size;
|
||||||
if (av_grow_packet(demuxer->pending, packet->size)) {
|
if (av_grow_packet(demuxer->pending, packet->size)) {
|
||||||
LOG_OOM();
|
LOG_OOM();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memcpy(demuxer->pending->data + offset, packet->data, packet->size);
|
||||||
} else {
|
} else {
|
||||||
offset = 0;
|
|
||||||
demuxer->pending = av_packet_alloc();
|
demuxer->pending = av_packet_alloc();
|
||||||
if (!demuxer->pending) {
|
if (!demuxer->pending) {
|
||||||
LOG_OOM();
|
LOG_OOM();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (av_new_packet(demuxer->pending, packet->size)) {
|
if (av_packet_ref(demuxer->pending, packet)) {
|
||||||
LOG_OOM();
|
LOG_OOM();
|
||||||
av_packet_free(&demuxer->pending);
|
av_packet_free(&demuxer->pending);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(demuxer->pending->data + offset, packet->data, packet->size);
|
|
||||||
|
|
||||||
if (!is_config) {
|
if (!is_config) {
|
||||||
// prepare the concat packet to send to the decoder
|
// prepare the concat packet to send to the decoder
|
||||||
demuxer->pending->pts = packet->pts;
|
demuxer->pending->pts = packet->pts;
|
||||||
|
|||||||
@@ -306,14 +306,13 @@ sc_screen_render(struct sc_screen *screen, bool update_content_rect) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__) || defined(__WINDOWS__)
|
||||||
# define CONTINUOUS_RESIZING_WORKAROUND
|
# define CONTINUOUS_RESIZING_WORKAROUND
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONTINUOUS_RESIZING_WORKAROUND
|
#ifdef CONTINUOUS_RESIZING_WORKAROUND
|
||||||
// On Windows and MacOS, resizing blocks the event loop, so resizing events are
|
// On Windows and MacOS, resizing blocks the event loop, so resizing events are
|
||||||
// not triggered. On MacOS, as a workaround, handle them in an event handler
|
// not triggered. As a workaround, handle them in an event handler.
|
||||||
// (it does not work for Windows unfortunately).
|
|
||||||
//
|
//
|
||||||
// <https://bugzilla.libsdl.org/show_bug.cgi?id=2077>
|
// <https://bugzilla.libsdl.org/show_bug.cgi?id=2077>
|
||||||
// <https://stackoverflow.com/a/40693139/1987178>
|
// <https://stackoverflow.com/a/40693139/1987178>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ echo "$PREBUILT_SERVER_SHA256 scrcpy-server" | sha256sum --check
|
|||||||
|
|
||||||
echo "[scrcpy] Building client..."
|
echo "[scrcpy] Building client..."
|
||||||
rm -rf "$BUILDDIR"
|
rm -rf "$BUILDDIR"
|
||||||
meson "$BUILDDIR" --buildtype=release --strip -Db_lto=true \
|
meson setup "$BUILDDIR" --buildtype=release --strip -Db_lto=true \
|
||||||
-Dprebuilt_server=scrcpy-server
|
-Dprebuilt_server=scrcpy-server
|
||||||
cd "$BUILDDIR"
|
cd "$BUILDDIR"
|
||||||
ninja
|
ninja
|
||||||
|
|||||||
Reference in New Issue
Block a user