Projects
Extra
vlc-beta
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 190
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/AUTHORS -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/AUTHORS
Changed
@@ -819,6 +819,7 @@ أحمد المحم ودي (Ahmed El-Mahmoudy) Баярсайхан Энхтайван Сергей Дарьичев +Noah Davis Artwork -------
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/include/vlc_decoder.h -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/include/vlc_decoder.h
Changed
@@ -86,6 +86,15 @@ VLC_API void vlc_input_decoder_Drain( vlc_input_decoder_t * ); /** + * Returns the drained state + * + * @warning This function need to be polled (every few ms) to know when the + * decoder is drained + * @return true if drained (after a call to vlc_input_decoder_Drain()) + */ + VLC_API bool vlc_input_decoder_IsDrained( vlc_input_decoder_t * ); + +/** * Requests that the decoder immediately discard all pending buffers. * This is useful when seeking or when deselecting a stream. */
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/modules/access/srt.c -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/modules/access/srt.c
Changed
@@ -99,7 +99,15 @@ char *psz_streamid = var_InheritString( p_stream, SRT_PARAM_STREAMID ); bool streamid_needs_free = true; char *url = NULL; - srt_params_t params; + srt_params_t params = { + .latency = -1, + .passphrase = NULL, + .key_length = SRT_DEFAULT_KEY_LENGTH, + .payload_size = SRT_DEFAULT_PAYLOAD_SIZE, + .bandwidth_overhead_limit = SRT_DEFAULT_BANDWIDTH_OVERHEAD_LIMIT, + .streamid = NULL, + .mode = SRT_DEFAULT_MODE, /* default = caller */ + }; struct addrinfo hints = { .ai_socktype = SOCK_DGRAM, }, *res = NULL; @@ -107,16 +115,43 @@ stream_sys_t *p_sys = p_stream->p_sys; bool failed = false; - stat = vlc_getaddrinfo( p_sys->psz_host, p_sys->i_port, &hints, &res ); - if ( stat ) + /* Parse URL */ + if (p_stream->psz_url) { + url = strdup( p_stream->psz_url ); + if ( !url ) { + failed = true; + goto out; + } + + if (srt_parse_url( url, ¶ms )) { + if (params.latency != -1) + i_latency = params.latency; + if (params.passphrase != NULL) { + free(psz_passphrase); + passphrase_needs_free = false; + psz_passphrase = (char *) params.passphrase; + } + if (params.streamid != NULL) { + free(psz_streamid); + streamid_needs_free = false; + psz_streamid = (char *) params.streamid; + } + } + } + + if (params.mode != SRT_MODE_LISTENER) { - msg_Err( p_stream, "Cannot resolve %s:%d (reason: %s)", - p_sys->psz_host, - p_sys->i_port, - gai_strerror( stat ) ); + stat = vlc_getaddrinfo( p_sys->psz_host, p_sys->i_port, &hints, &res); + if ( stat ) + { + msg_Err( p_stream, "Cannot resolve %s:%d (reason: %s)", + p_sys->psz_host, + p_sys->i_port, + gai_strerror( stat ) ); - failed = true; - goto out; + failed = true; + goto out; + } } /* Always start with a fresh socket */ @@ -125,7 +160,7 @@ srt_epoll_remove_usock( p_sys->i_poll_id, p_sys->sock ); srt_close( p_sys->sock ); } - + p_sys->sock = srt_create_socket( ); if ( p_sys->sock == SRT_INVALID_SOCK ) { @@ -134,24 +169,6 @@ goto out; } - if (p_stream->psz_url) { - url = strdup( p_stream->psz_url ); - if (srt_parse_url( url, ¶ms )) { - if (params.latency != -1) - i_latency = params.latency; - if (params.passphrase != NULL) { - free( psz_passphrase ); - passphrase_needs_free = false; - psz_passphrase = (char *) params.passphrase; - } - if (params.streamid != NULL ) { - free( psz_streamid ); - streamid_needs_free = false; - psz_streamid = (char *) params.streamid; - } - } - } - /* Make SRT non-blocking */ srt_setsockopt( p_sys->sock, 0, SRTO_SNDSYN, &(bool) { false }, sizeof( bool ) ); @@ -187,18 +204,99 @@ SRTO_STREAMID, psz_streamid, strlen(psz_streamid) ); } - srt_epoll_add_usock( p_sys->i_poll_id, p_sys->sock, - &(int) { SRT_EPOLL_ERR | SRT_EPOLL_IN }); + msg_Dbg(p_stream, "SRT mode=%d host='%s' port=%d", params.mode, + p_sys->psz_host ? p_sys->psz_host : "(null)", p_sys->i_port); + + if (params.mode == SRT_MODE_CALLER) + { + /* Schedule a connect */ + msg_Dbg( p_stream, "Schedule SRT connect (dest address: %s, port: %d).", + p_sys->psz_host, p_sys->i_port); + + stat = srt_connect( p_sys->sock, res->ai_addr, res->ai_addrlen ); + if (stat == SRT_ERROR) { + msg_Err( p_stream, "Failed to connect to server (reason: %s)", + srt_getlasterror_str() ); + failed = true; + goto out; + } + + srt_epoll_add_usock( p_sys->i_poll_id, p_sys->sock, + &(int) { SRT_EPOLL_ERR | SRT_EPOLL_IN }); + } + else if (params.mode == SRT_MODE_LISTENER) + { + msg_Dbg(p_stream, "Binding for SRT listener."); + + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_DGRAM, + .ai_flags = AI_PASSIVE + }, *res_local = NULL; + + /* Use the specific NIC or NULL for wildcard */ + char *node = NULL; + if (p_sys->psz_host && *p_sys->psz_host) + node = p_sys->psz_host; + + stat = vlc_getaddrinfo(node, p_sys->i_port, &hints, &res_local); + if (stat) { + msg_Err(p_stream, "Cannot resolve local address (reason: %s)", gai_strerror(stat)); + failed = true; goto out; + } + + /* If binding IPv6 configure the socket */ + if (res_local->ai_family == AF_INET6) { + srt_setsockopt(p_sys->sock, 0, SRTO_IPV6ONLY, &(int) { 0 }, sizeof(int)); + } - /* Schedule a connect */ - msg_Dbg( p_stream, "Schedule SRT connect (dest address: %s, port: %d).", - p_sys->psz_host, p_sys->i_port); + srt_setsockopt(p_sys->sock, 0, SRTO_REUSEADDR, &(int) { 1 }, sizeof(int)); - stat = srt_connect( p_sys->sock, res->ai_addr, res->ai_addrlen ); - if (stat == SRT_ERROR) { - msg_Err( p_stream, "Failed to connect to server (reason: %s)", - srt_getlasterror_str() ); + stat = srt_bind(p_sys->sock, res_local->ai_addr, res_local->ai_addrlen); + if ( stat ) { + msg_Err(p_stream, "Failed to bind socket (reason: %s)", srt_getlasterror_str()); + freeaddrinfo(res_local); + failed = true; + goto out; + } + + freeaddrinfo(res_local); + + stat = srt_listen(p_sys->sock, 1); + if ( stat ) { + msg_Err(p_stream, "Failed to listen on socket (reason: %s)", srt_getlasterror_str()); + failed = true; + goto out; + } + + if (srt_epoll_add_usock(p_sys->i_poll_id, p_sys->sock, + &(int) { SRT_EPOLL_ERR | SRT_EPOLL_IN }) < 0) { + msg_Err(p_stream, "epoll add failed: %s", srt_getlasterror_str()); + failed = true; + goto out; + } + + /* Try to accept a caller (non-blocking). */ + SRTSOCKET accepted = srt_accept(p_sys->sock, NULL, NULL); + if (accepted == SRT_INVALID_SOCK) { + int serr; + srt_getlasterror(&serr); + if (serr != SRT_EASYNCRCV && serr != SRT_EASYNCSND && serr != SRT_ETIMEOUT) { + msg_Warn(p_stream, "srt_accept() temporary error: %s", srt_getlasterror_str()); + } + } else { + srt_epoll_remove_usock(p_sys->i_poll_id, p_sys->sock); + srt_close(p_sys->sock); + p_sys->sock = accepted; + srt_epoll_add_usock(p_sys->i_poll_id, p_sys->sock, + &(int) { SRT_EPOLL_ERR | SRT_EPOLL_IN }); + } + } + else + { + msg_Err(p_stream, "Unknown SRT mode %d", params.mode); failed = true; + goto out; } /* Reset the number of chunks to allocate as the bitrate of @@ -218,7 +316,8 @@ free( psz_passphrase ); if (streamid_needs_free) free( psz_streamid ); - freeaddrinfo( res ); + if (res) + freeaddrinfo( res ); free( url ); return !failed; @@ -252,9 +351,9 @@ SRTSOCKET ready1; int readycnt = 1; - while ( srt_epoll_wait( p_sys->i_poll_id, - ready, &readycnt, 0, 0, - i_poll_timeout, NULL, 0, NULL, 0 ) >= 0) + while ( (readycnt = 1, + srt_epoll_wait(p_sys->i_poll_id, ready, &readycnt, + 0, 0, i_poll_timeout, NULL, 0, NULL, 0)) >= 0) { if ( readycnt < 0 || ready0 != p_sys->sock ) { @@ -265,6 +364,23 @@ switch( srt_getsockstate( p_sys->sock ) ) { + case SRTS_LISTENING: { + /* Try to accept a caller (non-blocking). */ + SRTSOCKET accepted = srt_accept(p_sys->sock, NULL, NULL); + if (accepted == SRT_INVALID_SOCK) { + int serr; srt_getlasterror(&serr); + /* No pending connection yet: keep waiting. */ + continue; + } + /* Swap listening socket -> connected socket */ + srt_epoll_remove_usock(p_sys->i_poll_id, p_sys->sock); + srt_close(p_sys->sock); + p_sys->sock = accepted; + srt_epoll_add_usock(p_sys->i_poll_id, p_sys->sock, + &(int){ SRT_EPOLL_ERR | SRT_EPOLL_IN }); + /* Now loop back; next iteration will see CONNECTED. */ + continue; + } case SRTS_CONNECTED: /* Good to go */ break; @@ -373,7 +489,11 @@ } p_sys->psz_host = vlc_obj_strdup( p_this, parsed_url.psz_host ); - p_sys->i_port = parsed_url.i_port; + + if ( parsed_url.i_port != 0 ) + p_sys->i_port = parsed_url.i_port; + else + p_sys->i_port = SRT_DEFAULT_PORT; vlc_UrlClean( &parsed_url ); @@ -436,7 +556,10 @@ SRT_KEY_LENGTH_TEXT, NULL ) change_integer_list( srt_key_lengths, srt_key_length_names ) add_string(SRT_PARAM_STREAMID, "", - N_(" SRT Stream ID"), NULL) + N_( "SRT Stream ID"), NULL) + add_integer( SRT_PARAM_MODE, SRT_DEFAULT_MODE, + SRT_MODE_TEXT, NULL ) + change_integer_list( srt_mode_values, srt_mode_names ) change_safe() set_capability("access", 0)
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/modules/access/srt_common.c -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/modules/access/srt_common.c
Changed
@@ -106,6 +106,7 @@ params->payload_size = -1; params->bandwidth_overhead_limit = -1; params->streamid = NULL; + params->mode = SRT_MODE_CALLER; /* Parse URL parameters */ query = find( url, '?' ); @@ -147,6 +148,12 @@ if (temp >= 0) params->bandwidth_overhead_limit = temp; + } else if (strcmp (local_paramsi.key, SRT_PARAM_MODE) == 0) { + if (strcmp(val, SRT_MODE_LISTENER_TEXT) == 0) { + params->mode = SRT_MODE_LISTENER; + } else { + params->mode = SRT_MODE_CALLER; + } } } }
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/modules/access/srt_common.h -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/modules/access/srt_common.h
Changed
@@ -40,6 +40,16 @@ #define SRT_PARAM_POLL_TIMEOUT "poll-timeout" #define SRT_PARAM_KEY_LENGTH "key-length" #define SRT_PARAM_STREAMID "streamid" +#define SRT_PARAM_MODE "mode" + +/* SRT modes */ +#define SRT_MODE_CALLER_TEXT "caller" +#define SRT_MODE_LISTENER_TEXT "listener" + +typedef enum srt_mode { + SRT_MODE_CALLER, + SRT_MODE_LISTENER, +} srt_mode_t; #define SRT_DEFAULT_BANDWIDTH_OVERHEAD_LIMIT 25 @@ -62,6 +72,13 @@ static const int srt_key_lengths = { 16, 24, 32, }; static const char * const srt_key_length_names = { N_( "16 bytes" ), N_( "24 bytes" ), N_( "32 bytes" ), }; +/* SRT modes */ +#define SRT_MODE_TEXT N_( "SRT mode" ) +#define SRT_DEFAULT_MODE SRT_MODE_CALLER +static const char * const srt_mode_names = { SRT_MODE_CALLER_TEXT, + SRT_MODE_LISTENER_TEXT, }; +static const int srt_mode_values = { SRT_MODE_CALLER, + SRT_MODE_LISTENER, }; typedef struct srt_params { int latency; @@ -70,6 +87,7 @@ int payload_size; int bandwidth_overhead_limit; const char* streamid; + srt_mode_t mode; } srt_params_t; bool srt_parse_url(char* url, srt_params_t* params);
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/modules/gui/macosx/main/macosx.m -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/modules/gui/macosx/main/macosx.m
Changed
@@ -107,6 +107,9 @@ #define ITUNES_TEXT N_("Control external music players") #define ITUNES_LONGTEXT N_("VLC will pause and resume supported music players on playback.") +#define AUTOLOAD_EXTENSIONS_TEXT N_("Automatically load extensions on startup") +#define AUTOLOAD_EXTENSIONS_LONGTEXT N_("Automatically load and enable VLC extensions when the application starts.") + static const int itunes_list = { 0, 1, 2 }; static const char *const itunes_list_text = { @@ -146,6 +149,7 @@ add_bool("macosx-pause-minimized", false, PAUSE_MINIMIZED_TEXT, PAUSE_MINIMIZED_LONGTEXT) add_bool("macosx-lock-aspect-ratio", true, LOCK_ASPECT_RATIO_TEXT, NULL) add_bool("macosx-dim-keyboard", false, DIM_KEYBOARD_PLAYBACK_TEXT, DIM_KEYBOARD_PLAYBACK_LONGTEXT) + add_bool("macosx-autoload-extensions", true, AUTOLOAD_EXTENSIONS_TEXT, AUTOLOAD_EXTENSIONS_LONGTEXT) add_integer("macosx-control-itunes", 1, ITUNES_TEXT, ITUNES_LONGTEXT) change_integer_list(itunes_list, itunes_list_text) add_integer("macosx-continue-playback", 0, CONTINUE_PLAYBACK_TEXT, CONTINUE_PLAYBACK_LONGTEXT)
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/modules/gui/macosx/menus/VLCMainMenu.m -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/modules/gui/macosx/menus/VLCMainMenu.m
Changed
@@ -244,11 +244,6 @@ extMgr buildMenu:_extensionsMenu; _extensions setEnabled:(_extensionsMenu numberOfItems > 0); - // FIXME: Implement preference for autoloading extensions on mac - // FIXME: this is definitely the wrong place to do this. - if (!extMgr isLoaded && !extMgr cannotLoad) - extMgr loadExtensions; - /* setup post-proc menu */ _postprocessingMenu removeAllItems; _postprocessingMenu setAutoenablesItems: YES;
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m
Changed
@@ -58,6 +58,11 @@ _isUnloading = false; b_failed = false; + + // Load extensions if autoload preference is enabled + if (var_InheritBool(getIntf(), "macosx-autoload-extensions")) { + self loadExtensions; + } } return self;
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/src/input/decoder.c -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/src/input/decoder.c
Changed
@@ -2486,27 +2486,41 @@ vlc_input_decoder_DecodeWithStatus(p_owner, frame, b_do_pace, NULL); } +static bool vlc_input_decoder_IsDrainedLocked(vlc_input_decoder_t *owner) +{ + vlc_fifo_Assert(owner->p_fifo); + + if (owner->p_sout_input != NULL) + return true; + else if (owner->fmt.i_cat == VIDEO_ES && owner->video.vout != NULL) + return vout_IsEmpty(owner->video.vout); + else if(owner->fmt.i_cat == AUDIO_ES && owner->audio.stream != NULL) + return vlc_aout_stream_IsDrained( owner->audio.stream); + else + return true; /* TODO subtitles support */ +} + +bool vlc_input_decoder_IsDrained(vlc_input_decoder_t *owner) +{ + vlc_fifo_Lock(owner->p_fifo); + bool drained = !owner->b_draining && vlc_input_decoder_IsDrainedLocked(owner); + vlc_fifo_Unlock(owner->p_fifo); + return drained; +} + bool vlc_input_decoder_IsEmpty( vlc_input_decoder_t * p_owner ) { assert( !p_owner->b_waiting ); vlc_fifo_Lock( p_owner->p_fifo ); - if( !vlc_fifo_IsEmpty( p_owner->p_fifo ) || p_owner->b_draining ) + if( !vlc_fifo_IsEmpty( p_owner->p_fifo ) ) { vlc_fifo_Unlock( p_owner->p_fifo ); return false; } - bool b_empty; + bool b_empty = vlc_input_decoder_IsDrainedLocked( p_owner ); - if( p_owner->p_sout_input != NULL ) - b_empty = true; - else if( p_owner->fmt.i_cat == VIDEO_ES && p_owner->video.vout != NULL ) - b_empty = vout_IsEmpty( p_owner->video.vout ); - else if( p_owner->fmt.i_cat == AUDIO_ES && p_owner->audio.stream != NULL ) - b_empty = vlc_aout_stream_IsDrained( p_owner->audio.stream ); - else - b_empty = true; /* TODO subtitles support */ vlc_fifo_Unlock( p_owner->p_fifo ); return b_empty;
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/src/input/es_out.c -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/src/input/es_out.c
Changed
@@ -663,7 +663,8 @@ { if (es->p_dec != NULL) { - vlc_input_decoder_Flush(es->p_dec); + if (!vlc_input_decoder_IsDrained(es->p_dec)) + vlc_input_decoder_Flush(es->p_dec); vlc_input_decoder_Delete(es->p_dec); } @@ -2455,7 +2456,8 @@ EsOutDeleteSubESes(sys, p_es); - vlc_input_decoder_Flush(p_es->p_dec); + if (!vlc_input_decoder_IsDrained(p_es->p_dec)) + vlc_input_decoder_Flush(p_es->p_dec); vlc_input_decoder_Delete( p_es->p_dec ); p_es->p_dec = NULL; if( p_es->p_pgrm->p_master_es_clock == p_es->p_clock ) @@ -2468,7 +2470,8 @@ if( p_es->p_dec_record ) { - vlc_input_decoder_Flush(p_es->p_dec_record); + if (!vlc_input_decoder_IsDrained(p_es->p_dec_record)) + vlc_input_decoder_Flush(p_es->p_dec_record); vlc_input_decoder_Delete( p_es->p_dec_record ); p_es->p_dec_record = NULL; } @@ -3090,8 +3093,8 @@ * bit too long if the ES is deleted in the middle of a stream. */ while( !input_Stopped(p_sys->p_input) && !p_sys->b_buffering ) { - if( vlc_input_decoder_IsEmpty( es->p_dec ) && - ( !es->p_dec_record || vlc_input_decoder_IsEmpty( es->p_dec_record ) )) + if( vlc_input_decoder_IsDrained( es->p_dec ) && + ( !es->p_dec_record || vlc_input_decoder_IsDrained( es->p_dec_record ) )) break; /* FIXME there should be a way to have auto deleted es, but there will be * a problem when another codec of the same type is created (mainly video) */
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/src/input/test/es_out.c -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/src/input/test/es_out.c
Changed
@@ -138,12 +138,17 @@ owner->started = true; } -bool vlc_input_decoder_IsEmpty(vlc_input_decoder_t *owner) +bool vlc_input_decoder_IsDrained(vlc_input_decoder_t *owner) { (void)owner; return owner->drained; } +bool vlc_input_decoder_IsEmpty(vlc_input_decoder_t *owner) +{ + return vlc_input_decoder_IsDrained(owner); +} + void vlc_input_decoder_DecodeWithStatus( vlc_input_decoder_t *owner, vlc_frame_t *frame,
View file
_service:obs_scm:vlc-beta-20251125.ba4c434b2.obscpio/src/libvlccore.sym -> _service:obs_scm:vlc-beta-20251127.0c1005305.obscpio/src/libvlccore.sym
Changed
@@ -188,6 +188,7 @@ vlc_input_decoder_Delete vlc_input_decoder_Decode vlc_input_decoder_Drain +vlc_input_decoder_IsDrained vlc_input_decoder_Flush vlc_input_decoder_SetSpuHighlight vlc_input_decoder_ChangeDelay
View file
_service:obs_scm:vlc-beta.obsinfo
Changed
@@ -1,4 +1,4 @@ name: vlc-beta -version: 20251125.ba4c434b2 -mtime: 1764079875 -commit: ba4c434b280a8949a770e5b886c74365d6ae7e10 +version: 20251127.0c1005305 +mtime: 1764241089 +commit: 0c100530542ccbaee72180bc380a31eccd3bda54
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.