[vlc-commits] [Git][videolan/vlc][3.0.x] 11 commits: modules: transform vlc_tick_t value to milliseconds with MS_FROM_VLC_TICK
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Apr 16 07:00:58 UTC 2026
Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
e265e8c5 by Steve Lhomme at 2026-04-16T06:05:09+00:00
modules: transform vlc_tick_t value to milliseconds with MS_FROM_VLC_TICK
(cherry picked from commit 18449933c8ce61ec8e72d4dfba3149f7050d8433) (edited)
edited:
- VLC 3 doesn't have vlc_tick_now()
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
9a9d6fc9 by Steve Lhomme at 2026-04-16T06:05:09+00:00
codec: uleaddvaudio: rework block release after using the data
- we don't need to pass a block double pointer, we never set the double pointer
to anything useful
- we can use a generic way to exit the function on error and success
- we need to release the source block once it has been used
Fixes #29518
(cherry picked from commit 443fe08fea6560cea2f23cc5bd5d5dd50a4ec8bc) (rebased)
rebased:
- VLC 3 doesn't use VLC_TICK_INVALID around the modified code
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
a93382ed by Steve Lhomme at 2026-04-16T06:05:09+00:00
srtp-aes: turn string of binary data into an array of values
Only sizeof() and memcmp() are used with these strings.
(cherry picked from commit 33ca5c1f9b145f570ac092c48aabb341b7d61eae)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
01c25096 by Marvin Scholz at 2026-04-16T06:05:09+00:00
qt: fix effects window geometry saving
On some operating systems, notably Linux, the setting keys are treated
as case-sensitive, so the mismatch here would cause the geometry to be
saved under a different key than it was read, effectively making the
restore not working properly.
(cherry picked from commit ef55a5509b424742034ee18fe860ccce154c73ba) (edited)
edited:
- in VLC 3 the file is still in gui/qt/dialogs
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
87e1601a by Steve Lhomme at 2026-04-16T06:05:09+00:00
stats: avoid pointer casting to copy a value
(cherry picked from commit d62255904c42707a6c4bc367a7f09afafcd6d50e) (edited)
edited:
- VLC 3 doesn't have vlc_tick_now()
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
214678ed by Mathias APARICIO at 2026-04-16T06:05:09+00:00
stats: fix possible NULL deref
block_Alloc may return NULL.
Check the return value to prevent a NULL dereference.
Fixes Coverity 1665660
(cherry picked from commit dd07a8119c96a572d11cc555d097cb06ad25d660) (rebased)
rebased:
- VLC 3 doesn't have vlc_tick_now()
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
643a40ef by Steve Lhomme at 2026-04-16T06:05:09+00:00
subtitle: do not use negative jacosub time resolutions
The format [^1] doesn't say it's not allowed but it doesn't make much sense.
Fixes #29321
[^1]: http://unicorn.us.com/jacosub/jscripts.html
(cherry picked from commit 5e37a14fc8ff8f79abcc843984acf74e1d841948)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
7639a634 by Abderhman Gamal at 2026-04-16T06:05:09+00:00
svg: replace deprecated rsvg_handle_get_dimensions
(cherry picked from commit 5512290f5e7848700a97e18233ffe5ab0ff5aacf)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
019511de by Alexandre Janniaux at 2026-04-16T06:05:09+00:00
svg: fix include path to cairo.h
pkg-config --cflags cairo returns the path to the folder containing
cairo.h.
(cherry picked from commit ce4be86d93dd694dcd42fd9c4b2f0c9dcb6d1b8d)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
7eac46f3 by felisevan at 2026-04-16T06:05:09+00:00
param_eq: fix incorrect filter type for high frequency band
(cherry picked from commit 18059c509cd0856b31463c322c084f1ccd695ab7)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
71f0a19e by Abderhman Gamal at 2026-04-16T06:05:09+00:00
access: sftp: replace deprecated libssh2_session_startup
Use libssh2_session_handshake() instead of libssh2_session_startup()
which was deprecated in libssh2 1.2.8.
Signed-off-by: Abderhman Gamal <abderhmangamal246 at gmail.com>
(cherry picked from commit 86d606dcd550a74f37a6b0aaa1a41c99c854c49e)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
12 changed files:
- modules/access/rtp/srtp-test-aes.c
- modules/access/sftp.c
- modules/audio_filter/param_eq.c
- modules/codec/svg.c
- modules/codec/uleaddvaudio.c
- modules/control/hotkeys.c
- modules/demux/gme.c
- modules/demux/subtitle.c
- modules/gui/qt/dialogs/extended.cpp
- modules/misc/stats.c
- modules/mux/asf.c
- modules/text_renderer/svg.c
Changes:
=====================================
modules/access/rtp/srtp-test-aes.c
=====================================
@@ -37,21 +37,21 @@ static void fatal (const char *msg)
static void test_derivation (void)
{
static const uint8_t key[16] =
- "\xE1\xF9\x7A\x0D\x3E\x01\x8B\xE0\xD6\x4F\xA3\x2C\x06\xDE\x41\x39";
+ {0xE1, 0xF9, 0x7A, 0x0D, 0x3E, 0x01, 0x8B, 0xE0, 0xD6, 0x4F, 0xA3, 0x2C, 0x06, 0xDE, 0x41, 0x39 };
static const uint8_t salt[14] =
- "\x0E\xC6\x75\xAD\x49\x8A\xFE\xEB\xB6\x96\x0B\x3A\xAB\xE6";
+ {0x0E, 0xC6, 0x75, 0xAD, 0x49, 0x8A, 0xFE, 0xEB, 0xB6, 0x96, 0x0B, 0x3A, 0xAB, 0xE6 };
static const uint8_t good_cipher[16] =
- "\xC6\x1E\x7A\x93\x74\x4F\x39\xEE\x10\x73\x4A\xFE\x3F\xF7\xA0\x87";
+ {0xC6, 0x1E, 0x7A, 0x93, 0x74, 0x4F, 0x39, 0xEE, 0x10, 0x73, 0x4A, 0xFE, 0x3F, 0xF7, 0xA0, 0x87 };
static const uint8_t good_salt[14] =
- "\x30\xCB\xBC\x08\x86\x3D\x8C\x85\xD4\x9D\xB3\x4A\x9A\xE1";
+ {0x30, 0xCB, 0xBC, 0x08, 0x86, 0x3D, 0x8C, 0x85, 0xD4, 0x9D, 0xB3, 0x4A, 0x9A, 0xE1 };
static const uint8_t good_auth[94] =
- "\xCE\xBE\x32\x1F\x6F\xF7\x71\x6B\x6F\xD4\xAB\x49\xAF\x25\x6A\x15"
- "\x6D\x38\xBA\xA4\x8F\x0A\x0A\xCF\x3C\x34\xE2\x35\x9E\x6C\xDB\xCE"
- "\xE0\x49\x64\x6C\x43\xD9\x32\x7A\xD1\x75\x57\x8E\xF7\x22\x70\x98"
- "\x63\x71\xC1\x0C\x9A\x36\x9A\xC2\xF9\x4A\x8C\x5F\xBC\xDD\xDC\x25"
- "\x6D\x6E\x91\x9A\x48\xB6\x10\xEF\x17\xC2\x04\x1E\x47\x40\x35\x76"
- "\x6B\x68\x64\x2C\x59\xBB\xFC\x2F\x34\xDB\x60\xDB\xDF\xB2";
+ {0xCE, 0xBE, 0x32, 0x1F, 0x6F, 0xF7, 0x71, 0x6B, 0x6F, 0xD4, 0xAB, 0x49, 0xAF, 0x25, 0x6A, 0x15,
+ 0x6D, 0x38, 0xBA, 0xA4, 0x8F, 0x0A, 0x0A, 0xCF, 0x3C, 0x34, 0xE2, 0x35, 0x9E, 0x6C, 0xDB, 0xCE,
+ 0xE0, 0x49, 0x64, 0x6C, 0x43, 0xD9, 0x32, 0x7A, 0xD1, 0x75, 0x57, 0x8E, 0xF7, 0x22, 0x70, 0x98,
+ 0x63, 0x71, 0xC1, 0x0C, 0x9A, 0x36, 0x9A, 0xC2, 0xF9, 0x4A, 0x8C, 0x5F, 0xBC, 0xDD, 0xDC, 0x25,
+ 0x6D, 0x6E, 0x91, 0x9A, 0x48, 0xB6, 0x10, 0xEF, 0x17, 0xC2, 0x04, 0x1E, 0x47, 0x40, 0x35, 0x76,
+ 0x6B, 0x68, 0x64, 0x2C, 0x59, 0xBB, 0xFC, 0x2F, 0x34, 0xDB, 0x60, 0xDB, 0xDF, 0xB2 };
static const uint8_t r[6] = { 0, 0, 0, 0, 0, 0 };
gcry_cipher_hd_t prf;
@@ -95,7 +95,7 @@ static void test_derivation (void)
static void test_keystream (void)
{
static const uint8_t key[16] =
- "\x2B\x7E\x15\x16\x28\xAE\xD2\xA6\xAB\xF7\x15\x88\x09\xCF\x4F\x3C";
+ {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C };
const uint32_t salt[4]=
{ htonl (0xf0f1f2f3), htonl (0xf4f5f6f7),
htonl (0xf8f9fafb), htonl (0xfcfd0000) };
@@ -122,13 +122,13 @@ static void test_keystream (void)
gcry_cipher_close (hd);
static const uint8_t good_start[48] =
- "\xE0\x3E\xAD\x09\x35\xC9\x5E\x80\xE1\x66\xB1\x6D\xD9\x2B\x4E\xB4"
- "\xD2\x35\x13\x16\x2B\x02\xD0\xF7\x2A\x43\xA2\xFE\x4A\x5F\x97\xAB"
- "\x41\xE9\x5B\x3B\xB0\xA2\xE8\xDD\x47\x79\x01\xE4\xFC\xA8\x94\xC0";
+ {0xE0, 0x3E, 0xAD, 0x09, 0x35, 0xC9, 0x5E, 0x80, 0xE1, 0x66, 0xB1, 0x6D, 0xD9, 0x2B, 0x4E, 0xB4,
+ 0xD2, 0x35, 0x13, 0x16, 0x2B, 0x02, 0xD0, 0xF7, 0x2A, 0x43, 0xA2, 0xFE, 0x4A, 0x5F, 0x97, 0xAB,
+ 0x41, 0xE9, 0x5B, 0x3B, 0xB0, 0xA2, 0xE8, 0xDD, 0x47, 0x79, 0x01, 0xE4, 0xFC, 0xA8, 0x94, 0xC0 };
static const uint8_t good_end[48] =
- "\xEC\x8C\xDF\x73\x98\x60\x7C\xB0\xF2\xD2\x16\x75\xEA\x9E\xA1\xE4"
- "\x36\x2B\x7C\x3C\x67\x73\x51\x63\x18\xA0\x77\xD7\xFC\x50\x73\xAE"
- "\x6A\x2C\xC3\x78\x78\x89\x37\x4F\xBE\xB4\xC8\x1B\x17\xBA\x6C\x44";
+ {0xEC, 0x8C, 0xDF, 0x73, 0x98, 0x60, 0x7C, 0xB0, 0xF2, 0xD2, 0x16, 0x75, 0xEA, 0x9E, 0xA1, 0xE4,
+ 0x36, 0x2B, 0x7C, 0x3C, 0x67, 0x73, 0x51, 0x63, 0x18, 0xA0, 0x77, 0xD7, 0xFC, 0x50, 0x73, 0xAE,
+ 0x6A, 0x2C, 0xC3, 0x78, 0x78, 0x89, 0x37, 0x4F, 0xBE, 0xB4, 0xC8, 0x1B, 0x17, 0xBA, 0x6C, 0x44 };
printf (" key stream: ");
printhex (buf, sizeof (good_start));
=====================================
modules/access/sftp.c
=====================================
@@ -205,9 +205,13 @@ static int SSHSessionInit( stream_t *p_access, const char *psz_host, int i_port
goto error;
int i_ret;
+ #if LIBSSH2_VERSION_NUM >= 0x010208
+ while( ( i_ret = libssh2_session_handshake( p_sys->ssh_session, p_sys->i_socket ) )
+ == LIBSSH2_ERROR_EAGAIN );
+ #else
while( ( i_ret = libssh2_session_startup( p_sys->ssh_session, p_sys->i_socket ) )
== LIBSSH2_ERROR_EAGAIN );
-
+ #endif
if( i_ret != 0 )
goto error;
=====================================
modules/audio_filter/param_eq.c
=====================================
@@ -144,7 +144,7 @@ static int Open( vlc_object_t *p_this )
i_samplerate, p_sys->coeffs+2*5);
CalcShelfEQCoeffs(p_sys->f_lowf, 1, p_sys->f_lowgain, 0,
i_samplerate, p_sys->coeffs+3*5);
- CalcShelfEQCoeffs(p_sys->f_highf, 1, p_sys->f_highgain, 0,
+ CalcShelfEQCoeffs(p_sys->f_highf, 1, p_sys->f_highgain, 1,
i_samplerate, p_sys->coeffs+4*5);
p_sys->p_state = (float*)calloc( p_filter->fmt_in.audio.i_channels*5*4,
sizeof(float) );
=====================================
modules/codec/svg.c
=====================================
@@ -37,7 +37,7 @@
#include <glib-object.h> /* g_object_unref( ) */
#include <librsvg/rsvg.h>
-#include <cairo/cairo.h>
+#include <cairo.h>
/*****************************************************************************
* Local prototypes
@@ -145,8 +145,31 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
goto done;
RsvgDimensionData dim;
+ #if LIBRSVG_MAJOR_VERSION > 2 || ( LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52 )
+ gboolean has_width, has_height, has_viewbox;
+ RsvgLength width, height;
+ RsvgRectangle viewbox;
+
+ rsvg_handle_get_intrinsic_dimensions( rsvg, &has_width, &width, &has_height, &height, &has_viewbox, &viewbox );
+
+ if( has_width && has_height && width.unit == RSVG_UNIT_PX && height.unit == RSVG_UNIT_PX )
+ {
+ dim.width = (int) width.length;
+ dim.height = (int) height.length;
+ }
+ else if( has_viewbox )
+ {
+ dim.width = (int) viewbox.width;
+ dim.height = (int) viewbox.height;
+ }
+ else
+ {
+ dim.width = 0;
+ dim.height = 0;
+ }
+ #else
rsvg_handle_get_dimensions( rsvg, &dim );
-
+ #endif
if( p_sys->f_scale > 0.0 )
{
i_width = (int32_t)(p_sys->f_scale * dim.width);
=====================================
modules/codec/uleaddvaudio.c
=====================================
@@ -61,20 +61,15 @@ static void Flush(decoder_t *dec)
date_Set(&sys->end_date, 0);
}
-static block_t *DecodeBlock(decoder_t *dec, block_t **block_ptr)
+static block_t *DecodeBlock(decoder_t *dec, block_t *block)
{
decoder_sys_t *sys = dec->p_sys;
+ block_t *output = NULL;
- if (!*block_ptr)
- return NULL;
-
- block_t *block = *block_ptr;
if (block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) {
Flush(dec);
if (block->i_flags & BLOCK_FLAG_CORRUPTED) {
- block_Release(block);
- *block_ptr = NULL;
- return NULL;
+ goto done;
}
}
@@ -84,8 +79,7 @@ static block_t *DecodeBlock(decoder_t *dec, block_t **block_ptr)
block->i_pts = VLC_TICK_INVALID;
if (!date_Get(&sys->end_date)) {
/* We've just started the stream, wait for the first PTS. */
- block_Release(block);
- return NULL;
+ goto done;
}
const unsigned int block_size = sys->is_pal ? 8640 : 7200;
@@ -98,10 +92,10 @@ static block_t *DecodeBlock(decoder_t *dec, block_t **block_ptr)
int sample_count = dv_get_audio_sample_count(&src[244], sys->is_pal);
if( decoder_UpdateAudioFormat(dec))
- return NULL;
- block_t *output = decoder_NewAudioBuffer(dec, sample_count);
+ goto done;
+ output = decoder_NewAudioBuffer(dec, sample_count);
if (!output)
- return NULL;
+ goto done;
output->i_pts = date_Get(&sys->end_date);
output->i_length = date_Increment(&sys->end_date, sample_count) - output->i_pts;
@@ -116,10 +110,10 @@ static block_t *DecodeBlock(decoder_t *dec, block_t **block_ptr)
*dst++ = GetWBE(&v[sys->is_pal ? 4320 : 3600]);
}
}
- return output;
}
+done:
block_Release(block);
- return NULL;
+ return output;
}
static int DecodeAudio(decoder_t *dec, block_t *block)
@@ -127,8 +121,8 @@ static int DecodeAudio(decoder_t *dec, block_t *block)
if (block == NULL) /* No Drain */
return VLCDEC_SUCCESS;
- block_t **block_ptr = &block, *out;
- while ((out = DecodeBlock(dec, block_ptr)) != NULL)
+ block_t *out;
+ while ((out = DecodeBlock(dec, block)) != NULL)
decoder_QueueAudio(dec,out);
return VLCDEC_SUCCESS;
}
=====================================
modules/control/hotkeys.c
=====================================
@@ -696,7 +696,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
var_SetInteger( p_input, "spu-delay", i_delay );
ClearChannels( p_vout, slider_chan );
DisplayMessage( p_vout, _( "Subtitle delay %i ms" ),
- (int)(i_delay/1000) );
+ (int)MS_FROM_VLC_TICK(i_delay) );
var_FreeList( &list, &list2 );
}
break;
@@ -713,7 +713,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
var_SetInteger( p_input, "audio-delay", i_delay );
ClearChannels( p_vout, slider_chan );
DisplayMessage( p_vout, _( "Audio delay %i ms" ),
- (int)(i_delay/1000) );
+ (int)MS_FROM_VLC_TICK(i_delay) );
}
break;
}
=====================================
modules/demux/gme.c
=====================================
@@ -277,7 +277,7 @@ static int Control (demux_t *demux, int query, va_list args)
|| (sys->titlev[sys->track_id]->i_length == 0))
break;
- int seek = (sys->titlev[sys->track_id]->i_length / 1000) * pos;
+ int seek = MS_FROM_VLC_TICK(sys->titlev[sys->track_id]->i_length) * pos;
if (gme_seek (sys->emu, seek))
break;
return VLC_SUCCESS;
=====================================
modules/demux/subtitle.c
=====================================
@@ -1926,7 +1926,7 @@ static int ParseJSS( vlc_object_t *p_obj, subs_properties_t *p_props,
break;
sscanf( &psz_text[shift], "%d", &p_props->jss.i_time_resolution );
- if( !p_props->jss.i_time_resolution )
+ if( !p_props->jss.i_time_resolution || p_props->jss.i_time_resolution < 0 )
p_props->jss.i_time_resolution = 30;
break;
}
=====================================
modules/gui/qt/dialogs/extended.cpp
=====================================
@@ -150,7 +150,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf )
ExtendedDialog::~ExtendedDialog()
{
- getSettings()->setValue("Epanel/geometry", saveGeometry());
+ getSettings()->setValue("EPanel/geometry", saveGeometry());
}
void ExtendedDialog::showTab( int i )
=====================================
modules/misc/stats.c
=====================================
@@ -52,19 +52,21 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
if( !p_pic )
goto error;
+ vlc_tick_t tick;
if( p_block->i_buffer == kBufferSize )
{
+ memcpy(&tick, p_block->p_buffer, sizeof(vlc_tick_t));
msg_Dbg( p_dec, "got %"PRIu64" ms",
- *(vlc_tick_t *)p_block->p_buffer / 1000 );
+ MS_FROM_VLC_TICK(tick) );
msg_Dbg( p_dec, "got %"PRIu64" ms offset",
- (mdate() - *(vlc_tick_t *)p_block->p_buffer) / 1000 );
- *(vlc_tick_t *)(p_pic->p->p_pixels) = *(vlc_tick_t *)p_block->p_buffer;
+ MS_FROM_VLC_TICK(mdate() - tick) );
}
else
{
msg_Dbg( p_dec, "got a packet not from stats demuxer" );
- *(vlc_tick_t *)(p_pic->p->p_pixels) = mdate();
+ tick = mdate();
}
+ memcpy(p_pic->p->p_pixels, &tick, sizeof(vlc_tick_t));
p_pic->date = p_block->i_pts > VLC_TICK_INVALID ?
p_block->i_pts : p_block->i_dts;
@@ -102,14 +104,16 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
{
(void)p_pict;
block_t * p_block = block_Alloc( kBufferSize );
-
- *(vlc_tick_t*)p_block->p_buffer = mdate();
+ if (unlikely(!p_block))
+ return NULL;
+ vlc_tick_t now = mdate();
+ memcpy(p_block->p_buffer, &now, sizeof(vlc_tick_t));
p_block->i_buffer = kBufferSize;
p_block->i_length = kBufferSize;
p_block->i_dts = p_pict->date;
msg_Dbg( p_enc, "putting %"PRIu64"ms",
- *(vlc_tick_t*)p_block->p_buffer / 1000 );
+ MS_FROM_VLC_TICK(now) );
return p_block;
}
@@ -153,8 +157,10 @@ static int Demux( demux_t *p_demux )
p_block->i_dts = p_block->i_pts =
date_Increment( &p_sys->pts, kBufferSize );
+ vlc_tick_t tick;
+ memcpy(&tick, p_block->p_buffer, sizeof(vlc_tick_t));
msg_Dbg( p_demux, "demux got %"PRId64" ms offset",
- (mdate() - *(vlc_tick_t *)p_block->p_buffer) / 1000 );
+ MS_FROM_VLC_TICK(mdate() - tick) );
//es_out_SetPCR( p_demux->out, p_block->i_pts );
=====================================
modules/mux/asf.c
=====================================
@@ -1156,7 +1156,7 @@ static block_t *asf_packet_flush( sout_mux_t *p_mux )
bo_add_u8( &bo, 0x11 );
bo_add_u8( &bo, 0x5d );
bo_addle_u16( &bo, i_pad );
- bo_addle_u32( &bo, (p_sys->i_pk_dts - p_sys->i_dts_first) / 1000 +
+ bo_addle_u32( &bo, MS_FROM_VLC_TICK(p_sys->i_pk_dts - p_sys->i_dts_first) +
p_sys->i_preroll_time );
bo_addle_u16( &bo, 0 /* data->i_length */ );
bo_add_u8( &bo, 0x80 | p_sys->i_pk_frame );
@@ -1216,7 +1216,7 @@ static block_t *asf_packet_create( sout_mux_t *p_mux,
bo_addle_u32( &bo, i_pos );
bo_add_u8 ( &bo, 0x08 ); /* flags */
bo_addle_u32( &bo, i_data );
- bo_addle_u32( &bo, (data->i_dts - p_sys->i_dts_first) / 1000 +
+ bo_addle_u32( &bo, MS_FROM_VLC_TICK(data->i_dts - p_sys->i_dts_first) +
p_sys->i_preroll_time );
bo_addle_u16( &bo, i_payload );
bo_add_mem ( &bo, &p_data[i_pos], i_payload );
=====================================
modules/text_renderer/svg.c
=====================================
@@ -43,7 +43,7 @@
#include <glib/gstdio.h>
#include <glib-object.h> /* g_object_unref( ) */
#include <librsvg/rsvg.h>
-#include <cairo/cairo.h>
+#include <cairo.h>
/*****************************************************************************
* Local prototypes
@@ -243,7 +243,31 @@ static picture_t * svg_RenderPicture( filter_t *p_filter,
}
RsvgDimensionData dim;
+ #if LIBRSVG_MAJOR_VERSION > 2 || ( LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52 )
+ gboolean has_width, has_height, has_viewbox;
+ RsvgLength width, height;
+ RsvgRectangle viewbox;
+
+ rsvg_handle_get_intrinsic_dimensions( p_handle, &has_width, &width, &has_height, &height, &has_viewbox, &viewbox );
+
+ if( has_width && has_height && width.unit == RSVG_UNIT_PX && height.unit == RSVG_UNIT_PX )
+ {
+ dim.width = (int) width.length;
+ dim.height = (int) height.length;
+ }
+ else if( has_viewbox )
+ {
+ dim.width = (int) viewbox.width;
+ dim.height = (int) viewbox.height;
+ }
+ else
+ {
+ dim.width = 0;
+ dim.height = 0;
+ }
+ #else
rsvg_handle_get_dimensions( p_handle, &dim );
+ #endif
float scale;
svg_RescaletoFit( p_filter, &dim.width, &dim.height, &scale );
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/328920c523eef72c15ee3b1a79da80319fa1350a...71f0a19e629886ae109d626fe0d6b87fcae017b7
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/328920c523eef72c15ee3b1a79da80319fa1350a...71f0a19e629886ae109d626fe0d6b87fcae017b7
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list