Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ade949ef by Steve Lhomme at 2022-06-29T07:44:52+00:00
libavi: use the stream_t directly

No need for some casts.

- - - - -
878ef35b by Steve Lhomme at 2022-06-29T07:44:52+00:00
hds: use the stream_t directly

No need for some casts.

- - - - -
3896ef57 by Steve Lhomme at 2022-06-29T07:44:52+00:00
video_window: don't cast to vlc_object_t*

- - - - -
119e6327 by Steve Lhomme at 2022-06-29T07:44:52+00:00
lib: media_discoverer: don't cast to vlc_object_t*

- - - - -
3338d1da by Steve Lhomme at 2022-06-29T07:44:52+00:00
srt: don't cast to vlc_object_t*

- - - - -
ef6f1088 by Steve Lhomme at 2022-06-29T07:44:52+00:00
satip: don't cast to vlc_object_t*

- - - - -
fbddc7ff by Steve Lhomme at 2022-06-29T07:44:52+00:00
rist: don't cast to vlc_object_t*

- - - - -
cfe9d815 by Steve Lhomme at 2022-06-29T07:44:52+00:00
ftp: don't cast to vlc_object_t*

- - - - -
85f0efcb by Steve Lhomme at 2022-06-29T07:44:52+00:00
mms: don't cast to vlc_object_t*

- - - - -
4ab2c3e9 by Steve Lhomme at 2022-06-29T07:44:52+00:00
omxil: don't cast to vlc_object_t*

- - - - -
dc2f7753 by Steve Lhomme at 2022-06-29T07:44:52+00:00
vulkan: don't cast to vlc_object_t*

- - - - -
02cabb2d by Steve Lhomme at 2022-06-29T07:44:52+00:00
demux: ts: don't cast to vlc_object_t*

- - - - -
cf2e37dd by Steve Lhomme at 2022-06-29T07:44:52+00:00
sap: don't cast to vlc_object_t*

- - - - -
18a0616f by Steve Lhomme at 2022-06-29T07:44:52+00:00
macosx: don't cast to vlc_object_t*

The same call is done in writeMetadataToFile.

- - - - -


16 changed files:

- lib/media_discoverer.c
- modules/access/ftp.c
- modules/access/mms/mmstu.c
- modules/access/rist.c
- modules/access/satip.c
- modules/access/srt.c
- modules/access_output/rist.c
- modules/access_output/srt.c
- modules/codec/omxil/omxil.c
- modules/demux/avi/libavi.c
- modules/demux/mpeg/ts.c
- modules/gui/macosx/library/VLCInputItem.m
- modules/services_discovery/sap.c
- modules/stream_filter/hds/hds.c
- modules/video_output/vulkan/platform.c
- src/video_output/video_window.c


Changes:

=====================================
lib/media_discoverer.c
=====================================
@@ -185,7 +185,7 @@ libvlc_media_discoverer_start( libvlc_media_discoverer_t * 
p_mdis )
     };
 
     /* Here we go */
-    p_mdis->p_sd = vlc_sd_Create( (vlc_object_t 
*)p_mdis->p_libvlc_instance->p_libvlc_int,
+    p_mdis->p_sd = vlc_sd_Create( 
VLC_OBJECT(p_mdis->p_libvlc_instance->p_libvlc_int),
                                   p_mdis->name, &owner );
     if( p_mdis->p_sd == NULL )
     {


=====================================
modules/access/ftp.c
=====================================
@@ -876,7 +876,7 @@ static int Seek( stream_t *p_access, uint64_t i_pos )
 {
     access_sys_t *p_sys = p_access->p_sys;
 
-    int val = SeekCommon( (vlc_object_t *)p_access, p_sys, i_pos );
+    int val = SeekCommon( VLC_OBJECT(p_access), p_sys, i_pos );
     if( val )
         return val;
 
@@ -888,7 +888,7 @@ static int Seek( stream_t *p_access, uint64_t i_pos )
 #ifdef ENABLE_SOUT
 static int OutSeek( sout_access_out_t *p_access, off_t i_pos )
 {
-    return SeekCommon((vlc_object_t *)p_access, GET_OUT_SYS(p_access), i_pos);
+    return SeekCommon(VLC_OBJECT(p_access), GET_OUT_SYS(p_access), i_pos);
 }
 #endif
 


=====================================
modules/access/mms/mmstu.c
=====================================
@@ -513,7 +513,7 @@ static int MMSOpen( stream_t  *p_access, vlc_url_t *p_url, 
int  i_proto )
             return VLC_EGENERIC;
         }
 
-        p_sys->i_handle_udp = net_ListenUDP1( (vlc_object_t *)p_access, 
p_sys->sz_bind_addr,
+        p_sys->i_handle_udp = net_ListenUDP1( VLC_OBJECT(p_access), 
p_sys->sz_bind_addr,
                                               7000 );
         if( p_sys->i_handle_udp < 0 )
         {


=====================================
modules/access/rist.c
=====================================
@@ -278,7 +278,7 @@ static int Open(vlc_object_t *p_this)
         goto failed;
     }
 
-    if( !rist_add_peers((vlc_object_t *)p_access, p_sys->receiver_ctx, 
p_access->psz_url, 0, RIST_DEFAULT_VIRT_DST_PORT, i_recovery_length) )
+    if( !rist_add_peers(VLC_OBJECT(p_access), p_sys->receiver_ctx, 
p_access->psz_url, 0, RIST_DEFAULT_VIRT_DST_PORT, i_recovery_length) )
         goto failed;
 
     /* Start the rist protocol thread */


=====================================
modules/access/satip.c
=====================================
@@ -286,7 +286,7 @@ static enum rtsp_result rtsp_handle(stream_t *access, bool 
*interrupted) {
 
     /* Parse header */
     while (!have_header) {
-        in = net_readln_timeout((vlc_object_t*)access, sys->tcp_sock, 5000,
+        in = net_readln_timeout(VLC_OBJECT(access), sys->tcp_sock, 5000,
                 interrupted);
         if (in == NULL)
             break;


=====================================
modules/access/srt.c
=====================================
@@ -91,7 +91,7 @@ static int Control(stream_t *p_stream, int i_query, va_list 
args)
 
 static bool srt_schedule_reconnect(stream_t *p_stream)
 {
-    vlc_object_t *strm_obj = (vlc_object_t *) p_stream;
+    vlc_object_t *strm_obj = VLC_OBJECT(p_stream);
     int i_latency=var_InheritInteger( p_stream, SRT_PARAM_LATENCY );
     int stat;
     char *psz_passphrase = var_InheritString( p_stream, SRT_PARAM_PASSPHRASE );


=====================================
modules/access_output/rist.c
=====================================
@@ -189,7 +189,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    p_sys->i_max_packet_size = rist_get_max_packet_size((vlc_object_t 
*)p_access);
+    p_sys->i_max_packet_size = rist_get_max_packet_size(VLC_OBJECT(p_access));
 
     int i_rist_profile = var_InheritInteger(p_access, RIST_CFG_PREFIX 
RIST_URL_PARAM_PROFILE);
     int i_verbose_level = var_InheritInteger(p_access, RIST_CFG_PREFIX 
RIST_URL_PARAM_VERBOSE_LEVEL);
@@ -224,7 +224,7 @@ static int Open( vlc_object_t *p_this )
     int i_recovery_length = var_InheritInteger(p_access, RIST_CFG_PREFIX 
RIST_CFG_LATENCY);
     p_sys->i_recovery_buffer = i_recovery_length;
 
-    if ( !rist_add_peers((vlc_object_t *)p_access, p_sys->sender_ctx, 
p_access->psz_path, i_multipeer_mode, p_sys->gre_dst_port + 1, 
i_recovery_length) )
+    if ( !rist_add_peers(VLC_OBJECT(p_access), p_sys->sender_ctx, 
p_access->psz_path, i_multipeer_mode, p_sys->gre_dst_port + 1, 
i_recovery_length) )
         goto failed;
 
     if (rist_start(p_sys->sender_ctx) == -1) {


=====================================
modules/access_output/srt.c
=====================================
@@ -63,7 +63,7 @@ static void srt_wait_interrupted(void *p_data)
 
 static bool srt_schedule_reconnect(sout_access_out_t *p_access)
 {
-    vlc_object_t *access_obj = (vlc_object_t *) p_access;
+    vlc_object_t *access_obj = VLC_OBJECT(p_access);
     int stat;
     char *psz_dst_addr = NULL;
     int i_dst_port;


=====================================
modules/codec/omxil/omxil.c
=====================================
@@ -1724,7 +1724,7 @@ static OMX_ERRORTYPE OmxEventHandler( OMX_HANDLETYPE 
omx_handle,
     unsigned int i;
     (void)omx_handle;
 
-    PrintOmxEvent((vlc_object_t *) p_dec, event, data_1, data_2, event_data);
+    PrintOmxEvent(VLC_OBJECT(p_dec), event, data_1, data_2, event_data);
     switch (event)
     {
     case OMX_EventError:


=====================================
modules/demux/avi/libavi.c
=====================================
@@ -97,7 +97,7 @@ static int AVI_ChunkReadCommon( stream_t *s, avi_chunk_t 
*p_chk,
     }
 
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s,
+    msg_Dbg( s,
              "found chunk, fourcc: %4.4s size:%"PRIu64" pos:%"PRIu64,
              (char*)&p_chk->common.i_chunk_fourcc,
              p_chk->common.i_chunk_size,
@@ -153,12 +153,12 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t 
*p_container )
     if( p_container->common.i_chunk_size > 0 && 
p_container->common.i_chunk_size < 4 )
     {
         /* empty box */
-        msg_Warn( (vlc_object_t*)s, "empty list chunk" );
+        msg_Warn( s, "empty list chunk" );
         return VLC_EGENERIC;
     }
     if( vlc_stream_Peek( s, &p_peek, 12 ) < 12 )
     {
-        msg_Warn( (vlc_object_t*)s, "unexpected end of file while reading list 
chunk" );
+        msg_Warn( s, "unexpected end of file while reading list chunk" );
         return VLC_EGENERIC;
     }
 
@@ -178,22 +178,22 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t 
*p_container )
     {
         if( !b_seekable )
             return VLC_SUCCESS;
-        msg_Dbg( (vlc_object_t*)s, "skipping movi chunk" );
+        msg_Dbg( s, "skipping movi chunk" );
         return AVI_NextChunk( s, p_container ); /* points at beginning of 
LIST-movi if not seekable */
     }
 
     if( vlc_stream_Read( s, NULL, 12 ) != 12 )
     {
-        msg_Warn( (vlc_object_t*)s, "cannot enter chunk" );
+        msg_Warn( s, "cannot enter chunk" );
         return VLC_EGENERIC;
     }
 
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s,
+    msg_Dbg( s,
              "found LIST chunk: \'%4.4s\'",
              (char*)&p_container->list.i_type );
 #endif
-    msg_Dbg( (vlc_object_t*)s, "<list \'%4.4s\'>", 
(char*)&p_container->list.i_type );
+    msg_Dbg( s, "<list \'%4.4s\'>", (char*)&p_container->list.i_type );
 
     union  avi_chunk_u **pp_append = &p_container->common.p_first;
     for( ; ; )
@@ -235,7 +235,7 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t 
*p_container )
         }
 
     }
-    msg_Dbg( (vlc_object_t*)s, "</list \'%4.4s\'>%x", 
(char*)&p_container->list.i_type, i_ret );
+    msg_Dbg( s, "</list \'%4.4s\'>%x", (char*)&p_container->list.i_type, i_ret 
);
 
     if( i_ret == AVI_ZERO_FOURCC || i_ret == AVI_ZEROSIZED_CHUNK )
         return AVI_GotoNextChunk( s, p_container );
@@ -377,7 +377,7 @@ static int AVI_ChunkRead_avih( stream_t *s, avi_chunk_t 
*p_chk )
     AVI_READ4BYTES( p_chk->avih.i_start );
     AVI_READ4BYTES( p_chk->avih.i_length );
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s,
+    msg_Dbg( s,
              "avih: streams:%d flags:%s%s%s%s %dx%d",
              p_chk->avih.i_streams,
              p_chk->avih.i_flags&AVIF_HASINDEX?" HAS_INDEX":"",
@@ -406,7 +406,7 @@ static int AVI_ChunkRead_strh( stream_t *s, avi_chunk_t 
*p_chk )
     AVI_READ4BYTES( p_chk->strh.i_quality );
     AVI_READ4BYTES( p_chk->strh.i_samplesize );
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s,
+    msg_Dbg( s,
              "strh: type:%4.4s handler:0x%8.8x samplesize:%d %.2ffps",
              (char*)&p_chk->strh.i_type,
              p_chk->strh.i_handler,
@@ -425,12 +425,12 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t 
*p_chk )
     AVI_READCHUNK_ENTER;
     if( p_chk->common.p_father == NULL )
     {
-        msg_Err( (vlc_object_t*)s, "malformed avi file" );
+        msg_Err( s, "malformed avi file" );
         AVI_READCHUNK_EXIT( VLC_EGENERIC );
     }
     if( !( p_strh = AVI_ChunkFind( p_chk->common.p_father, AVIFOURCC_strh, 0, 
false ) ) )
     {
-        msg_Err( (vlc_object_t*)s, "malformed avi file" );
+        msg_Err( s, "malformed avi file" );
         AVI_READCHUNK_EXIT( p_chk->common.i_chunk_size > 0  ? VLC_EGENERIC : 
AVI_ZEROSIZED_CHUNK );
     }
 
@@ -479,7 +479,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t 
*p_chk )
                         p_chk->strf.auds.p_wf->cbSize );
             }
 #ifdef AVI_DEBUG
-            msg_Dbg( (vlc_object_t*)s,
+            msg_Dbg( s,
                      "strf: audio:0x%4.4x channels:%d %dHz %dbits/sample 
%dkbps",
                      p_chk->strf.auds.p_wf->wFormatTag,
                      p_chk->strf.auds.p_wf->nChannels,
@@ -544,7 +544,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t 
*p_chk )
             }
             else p_chk->strf.vids.p_bih->biClrUsed = 0;
 #ifdef AVI_DEBUG
-            msg_Dbg( (vlc_object_t*)s,
+            msg_Dbg( s,
                      "strf: video:%4.4s %"PRIu32"x%"PRIu32" planes:%d %dbpp",
                      (char*)&p_chk->strf.vids.p_bih->biCompression,
                      (uint32_t)p_chk->strf.vids.p_bih->biWidth,
@@ -562,7 +562,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t 
*p_chk )
             p_chk->strf.common.i_cat = SPU_ES;
             break;
         default:
-            msg_Warn( (vlc_object_t*)s, "unknown stream type: %4.4s",
+            msg_Warn( s, "unknown stream type: %4.4s",
                     (char*)&p_strh->strh.i_type );
             p_chk->strf.common.i_cat = UNKNOWN_ES;
             break;
@@ -586,7 +586,7 @@ static int AVI_ChunkRead_strd( stream_t *s, avi_chunk_t 
*p_chk )
 {
     if ( p_chk->common.i_chunk_size == 0 )
     {
-        msg_Dbg( (vlc_object_t*)s, "Zero sized pre-JUNK section met" );
+        msg_Dbg( s, "Zero sized pre-JUNK section met" );
         return AVI_ZEROSIZED_CHUNK;
     }
 
@@ -631,7 +631,7 @@ static int AVI_ChunkRead_idx1( stream_t *s, avi_chunk_t 
*p_chk )
         p_chk->idx1.entry = NULL;
     }
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s, "idx1: index entry:%d", i_count );
+    msg_Dbg( s, "idx1: index entry:%d", i_count );
 #endif
     AVI_READCHUNK_EXIT( VLC_SUCCESS );
 }
@@ -725,11 +725,11 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t 
*p_chk )
     }
     else
     {
-        msg_Warn( (vlc_object_t*)s, "unknown type/subtype index" );
+        msg_Warn( s, "unknown type/subtype index" );
     }
 
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s, "indx: type=%d subtype=%d entry=%d",
+    msg_Dbg( s, "indx: type=%d subtype=%d entry=%d",
              p_indx->i_indextype, p_indx->i_indexsubtype, 
p_indx->i_entriesinuse );
 #endif
     AVI_READCHUNK_EXIT( i_ret );
@@ -771,7 +771,7 @@ static int AVI_ChunkRead_vprp( stream_t *s, avi_chunk_t 
*p_chk )
     }
 
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s, "vprp: format:%d standard:%d",
+    msg_Dbg( s, "vprp: format:%d standard:%d",
              p_vprp->i_video_format_token, p_vprp->i_video_standard );
 #endif
     AVI_READCHUNK_EXIT( VLC_SUCCESS );
@@ -786,7 +786,7 @@ static int AVI_ChunkRead_dmlh( stream_t *s, avi_chunk_t 
*p_chk )
     AVI_READ4BYTES( p_dmlh->dwTotalFrames );
 
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s, "dmlh: dwTotalFrames %d",
+    msg_Dbg( s, "dmlh: dwTotalFrames %d",
              p_dmlh->dwTotalFrames );
 #endif
     AVI_READCHUNK_EXIT( VLC_SUCCESS );
@@ -876,7 +876,7 @@ static int AVI_ChunkRead_strz( stream_t *s, avi_chunk_t 
*p_chk )
     p_strz->p_str[p_strz->i_chunk_size] = 0;
 
 #ifdef AVI_DEBUG
-    msg_Dbg( (vlc_object_t*)s, "%4.4s: %s : %s",
+    msg_Dbg( s, "%4.4s: %s : %s",
              (char*)&p_strz->i_chunk_fourcc, p_strz->p_type, p_strz->p_str);
 #endif
     AVI_READCHUNK_EXIT( VLC_SUCCESS );
@@ -994,7 +994,7 @@ int  AVI_ChunkRead( stream_t *s, avi_chunk_t *p_chk, 
avi_chunk_t *p_father )
 
     if( !p_chk )
     {
-        msg_Warn( (vlc_object_t*)s, "cannot read null chunk" );
+        msg_Warn( s, "cannot read null chunk" );
         return VLC_EGENERIC;
     }
 
@@ -1003,7 +1003,7 @@ int  AVI_ChunkRead( stream_t *s, avi_chunk_t *p_chk, 
avi_chunk_t *p_father )
 
     if( p_chk->common.i_chunk_fourcc == VLC_FOURCC( 0, 0, 0, 0 ) )
     {
-        msg_Warn( (vlc_object_t*)s, "found null fourcc chunk (corrupted 
file?)" );
+        msg_Warn( s, "found null fourcc chunk (corrupted file?)" );
         return AVI_ZERO_FOURCC;
     }
     p_chk->common.p_father = p_father;
@@ -1022,7 +1022,7 @@ int  AVI_ChunkRead( stream_t *s, avi_chunk_t *p_chk, 
avi_chunk_t *p_father )
         return AVI_ChunkRead_indx( s, p_chk );
     }
 
-    msg_Warn( (vlc_object_t*)s, "unknown chunk: %4.4s (not loaded)",
+    msg_Warn( s, "unknown chunk: %4.4s (not loaded)",
             (char*)&p_chk->common.i_chunk_fourcc );
     return AVI_NextChunk( s, p_chk );
 }
@@ -1052,14 +1052,14 @@ void AVI_ChunkClean( stream_t *s,
     if( AVI_Chunk_Function[i_index].AVI_ChunkFree_function )
     {
 #ifdef AVI_DEBUG
-        msg_Dbg( (vlc_object_t*)s, "free chunk %4.4s",
+        msg_Dbg( s, "free chunk %4.4s",
                  (char*)&p_chk->common.i_chunk_fourcc );
 #endif
         AVI_Chunk_Function[i_index].AVI_ChunkFree_function( p_chk);
     }
     else if( p_chk->common.i_chunk_fourcc != 0 )
     {
-        msg_Warn( (vlc_object_t*)s, "unknown chunk: %4.4s (not unloaded)",
+        msg_Warn( s, "unknown chunk: %4.4s (not unloaded)",
                 (char*)&p_chk->common.i_chunk_fourcc );
     }
     p_chk->common.p_first = NULL;
@@ -1163,7 +1163,7 @@ int AVI_ChunkReadRoot( stream_t *s, avi_chunk_t *p_root )
 
     p_list->i_chunk_size = stream_Size( s );
 
-    AVI_ChunkDumpDebug_level( (vlc_object_t*)s, p_root, 0 );
+    AVI_ChunkDumpDebug_level( VLC_OBJECT(s), p_root, 0 );
     return VLC_SUCCESS;
 }
 


=====================================
modules/demux/mpeg/ts.c
=====================================
@@ -454,21 +454,21 @@ static int Open( vlc_object_t *p_this )
         if( p_sys->csa )
         {
             psz_csa2 = var_CreateGetStringCommand( p_demux, "ts-csa2-ck" );
-            i_res = csa_SetCW( (vlc_object_t*)p_demux, p_sys->csa, psz_string, 
true );
+            i_res = csa_SetCW( VLC_OBJECT(p_demux), p_sys->csa, psz_string, 
true );
         }
         else
             i_res = VLC_ENOMEM;
 
         if( i_res == VLC_SUCCESS && psz_csa2 && *psz_csa2 )
         {
-            if( csa_SetCW( (vlc_object_t*)p_demux, p_sys->csa, psz_csa2, false 
) != VLC_SUCCESS )
+            if( csa_SetCW( VLC_OBJECT(p_demux), p_sys->csa, psz_csa2, false ) 
!= VLC_SUCCESS )
             {
-                csa_SetCW( (vlc_object_t*)p_demux, p_sys->csa, psz_string, 
false );
+                csa_SetCW( VLC_OBJECT(p_demux), p_sys->csa, psz_string, false 
);
             }
         }
         else if ( i_res == VLC_SUCCESS )
         {
-            csa_SetCW( (vlc_object_t*)p_demux, p_sys->csa, psz_string, false );
+            csa_SetCW( VLC_OBJECT(p_demux), p_sys->csa, psz_string, false );
         }
         else
         {


=====================================
modules/gui/macosx/library/VLCInputItem.m
=====================================
@@ -482,7 +482,7 @@ static const struct input_preparser_callbacks_t 
preparseCallbacks = {
 - (void)parseInputItem
 {
     _p_parserID = input_item_Parse(_vlcInputItem,
-                                   (vlc_object_t *)getIntf(),
+                                   VLC_OBJECT(getIntf()),
                                    &parserCallbacks,
                                    (__bridge void *) self);
 }


=====================================
modules/services_discovery/sap.c
=====================================
@@ -248,7 +248,7 @@ static int RemoveAnnounce( services_discovery_t *p_sd,
 static int InitSocket( services_discovery_t *p_sd, const char *psz_address,
                        int i_port )
 {
-    int i_fd = net_ListenUDP1 ((vlc_object_t *)p_sd, psz_address, i_port);
+    int i_fd = net_ListenUDP1 (VLC_OBJECT(p_sd), psz_address, i_port);
     if (i_fd == -1)
         return VLC_EGENERIC;
 


=====================================
modules/stream_filter/hds/hds.c
=====================================
@@ -917,17 +917,16 @@ static void* download_thread( void* p )
 }
 
 static chunk_t* generate_new_chunk(
-    vlc_object_t* p_this,
+    stream_t* s,
     chunk_t* last_chunk,
     hds_stream_t* hds_stream )
 {
-    stream_t* s = (stream_t*) p_this;
     stream_sys_t *sys = s->p_sys;
     chunk_t *chunk = chunk_new();
     unsigned int frun_entry = 0;
 
     if( ! chunk ) {
-        msg_Err( p_this, "Couldn't allocate new chunk!" );
+        msg_Err( s, "Couldn't allocate new chunk!" );
         return NULL;
     }
 
@@ -963,7 +962,7 @@ static chunk_t* generate_new_chunk(
         {
             if( frun_entry == hds_stream->fragment_run_count - 1 )
             {
-                msg_Err( p_this, "Discontinuity but can't find next 
timestamp!");
+                msg_Err( s, "Discontinuity but can't find next timestamp!");
                 chunk_free( chunk );
                 return NULL;
             }
@@ -1005,7 +1004,7 @@ static chunk_t* generate_new_chunk(
 
     if( frun_entry == hds_stream->fragment_run_count )
     {
-        msg_Err( p_this, "Couldn'd find the fragment run!" );
+        msg_Err( s, "Couldn'd find the fragment run!" );
         chunk_free( chunk );
         return NULL;
     }
@@ -1046,7 +1045,7 @@ static chunk_t* generate_new_chunk(
 }
 
 static void maintain_live_chunks(
-    vlc_object_t* p_this,
+    stream_t *s,
     hds_stream_t* hds_stream
     )
 {
@@ -1057,7 +1056,7 @@ static void maintain_live_chunks(
          * but then we are right on the edge of buffering, esp for
          * small fragments */
         hds_stream->chunks_head = generate_new_chunk(
-            p_this, 0, hds_stream );
+            s, 0, hds_stream );
         hds_stream->chunks_livereadpos = hds_stream->chunks_head;
     }
 
@@ -1073,7 +1072,7 @@ static void maintain_live_chunks(
         }
         else
         {
-            chunk->next = generate_new_chunk( p_this, chunk, hds_stream );
+            chunk->next = generate_new_chunk( s, chunk, hds_stream );
             chunk = chunk->next;
             dl = true;
         }
@@ -1101,8 +1100,7 @@ static void* live_thread( void* p )
 {
     vlc_thread_set_name("vlc-hds-live");
 
-    vlc_object_t* p_this = (vlc_object_t*)p;
-    stream_t* s = (stream_t*) p_this;
+    stream_t *s = (stream_t*)p;
     stream_sys_t* sys = s->p_sys;
 
     if ( vlc_array_count( &sys->hds_streams ) == 0 )
@@ -1139,10 +1137,10 @@ static void* live_thread( void* p )
     while( ! sys->closed )
     {
         last_dl_start_time = vlc_tick_now();
-        stream_t* download_stream = vlc_stream_NewURL( p_this, abst_url );
+        stream_t* download_stream = vlc_stream_NewURL( s, abst_url );
         if( ! download_stream )
         {
-            msg_Err( p_this, "Failed to download abst %s", abst_url );
+            msg_Err( s, "Failed to download abst %s", abst_url );
         }
         else
         {
@@ -1152,17 +1150,17 @@ static void* live_thread( void* p )
                                     size );
             if( read < size )
             {
-                msg_Err( p_this, "Requested %"PRIi64" bytes, "  \
+                msg_Err( s, "Requested %"PRIi64" bytes, "  \
                          "but only got %d", size, read );
 
             }
             else
             {
                 vlc_mutex_lock( & hds_stream->abst_lock );
-                parse_BootstrapData( p_this, hds_stream,
+                parse_BootstrapData( VLC_OBJECT(s), hds_stream,
                                      data, data + read );
                 vlc_mutex_unlock( & hds_stream->abst_lock );
-                maintain_live_chunks( p_this, hds_stream );
+                maintain_live_chunks( s, hds_stream );
             }
 
             free( data );
@@ -1343,7 +1341,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
         case XML_READER_ENDELEM:
             if( current_element && ! strcmp( current_element, "bootstrapInfo") 
) {
                 if( bootstrap_idx + 1 == MAX_BOOTSTRAP_INFO ) {
-                    msg_Warn( (vlc_object_t*) s, "Too many bootstraps, 
ignoring" );
+                    msg_Warn( s, "Too many bootstraps, ignoring" );
                 } else {
                     bootstrap_idx++;
                 }
@@ -1365,7 +1363,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
         {
             if( media_idx == MAX_MEDIA_ELEMENTS )
             {
-                msg_Err( (vlc_object_t*) s, "Too many media elements, 
quitting" );
+                msg_Err( s, "Too many media elements, quitting" );
                 free(media_id);
                 return VLC_EGENERIC;
             }
@@ -1448,7 +1446,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
                     vlc_b64_decode_binary( 
(uint8_t**)&bootstraps[bootstrap_idx].data, start );
                 if( ! bootstraps[bootstrap_idx].data )
                 {
-                    msg_Err( (vlc_object_t*) s, "Couldn't decode bootstrap 
info" );
+                    msg_Err( s, "Couldn't decode bootstrap info" );
                 }
             }
             else if( ! strcmp( current_element, "duration" ) )
@@ -1490,7 +1488,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
                     if ( ( end_marker < medias[mi].metadata ) ||
                          memcmp(end_marker, amf_object_end, 
sizeof(amf_object_end)) != 0 )
                     {
-                        msg_Dbg( (vlc_object_t*)s, "Ignoring invalid metadata 
packet on stream %d", mi );
+                        msg_Dbg( s, "Ignoring invalid metadata packet on 
stream %d", mi );
                         FREENULL( medias[mi].metadata );
                         medias[mi].metadata_len = 0;
                     }
@@ -1555,7 +1553,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
 
                 if( ! sys->live )
                 {
-                    parse_BootstrapData( (vlc_object_t*)s,
+                    parse_BootstrapData( VLC_OBJECT(s),
                                          new_stream,
                                          bootstraps[j].data,
                                          bootstraps[j].data + 
bootstraps[j].data_len );
@@ -1563,13 +1561,13 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
                     new_stream->download_leadtime = 15;
 
                     new_stream->chunks_head = generate_new_chunk(
-                        (vlc_object_t*) s, 0, new_stream );
+                        s, 0, new_stream );
                     chunk_t* chunk = new_stream->chunks_head;
                     uint64_t total_duration = chunk->duration;
                     while( chunk && total_duration/new_stream->afrt_timescale 
< new_stream->download_leadtime )
                     {
                         chunk->next = generate_new_chunk(
-                            (vlc_object_t*) s, chunk, new_stream );
+                            s, chunk, new_stream );
                         chunk = chunk->next;
                         if( chunk )
                             total_duration += chunk->duration;
@@ -1591,7 +1589,7 @@ static int parse_Manifest( stream_t *s, manifest_t *m )
 
                 vlc_array_append_or_abort( &sys->hds_streams, new_stream );
 
-                msg_Info( (vlc_object_t*)s, "New track with 
quality_segment(%s), bitrate(%u), timescale(%u), movie_id(%s), 
segment_run_count(%d), fragment_run_count(%u)",
+                msg_Info( s, "New track with quality_segment(%s), bitrate(%u), 
timescale(%u), movie_id(%s), segment_run_count(%d), fragment_run_count(%u)",
                           
new_stream->quality_segment_modifier?new_stream->quality_segment_modifier:"", 
new_stream->bitrate, new_stream->timescale,
                           new_stream->movie_id, new_stream->segment_run_count, 
new_stream->fragment_run_count );
 
@@ -1755,11 +1753,10 @@ static int send_flv_header( hds_stream_t *stream, 
stream_sys_t* p_sys,
 }
 
 static unsigned read_chunk_data(
-    vlc_object_t* p_this,
+    stream_t* s,
     uint8_t* buffer, unsigned read_len,
     hds_stream_t* stream )
 {
-    stream_t* s = (stream_t*) p_this;
     stream_sys_t* sys = s->p_sys;
     chunk_t* chunk = stream->chunks_head;
     uint8_t* buffer_start = buffer;
@@ -1793,7 +1790,7 @@ static unsigned read_chunk_data(
             /* make sure there is at least one chunk in the queue */
             if( ! chunk->next && ! chunk->eof )
             {
-                chunk->next = generate_new_chunk( p_this, chunk,  stream );
+                chunk->next = generate_new_chunk( s, chunk,  stream );
                 dl = true;
             }
 
@@ -1826,7 +1823,7 @@ static unsigned read_chunk_data(
             {
                 if( ! chunk->next && ! chunk->eof )
                 {
-                    chunk->next = generate_new_chunk( p_this, chunk, stream );
+                    chunk->next = generate_new_chunk( s, chunk, stream );
                     dl = true;
                 }
 
@@ -1868,7 +1865,7 @@ static ssize_t Read( stream_t *s, void *buffer, size_t 
i_read )
     if ( header_unfinished( p_sys ) )
         return send_flv_header( stream, p_sys, buffer, i_read );
 
-    return read_chunk_data( (vlc_object_t*)s, buffer, i_read, stream );
+    return read_chunk_data( s, buffer, i_read, stream );
 }
 
 static int Control( stream_t *s, int i_query, va_list args )


=====================================
modules/video_output/vulkan/platform.c
=====================================
@@ -50,7 +50,7 @@ static int vlc_vk_start(void *func, bool forced, va_list ap)
  */
 vlc_vk_platform_t *vlc_vk_platform_Create(struct vlc_window *wnd, const char 
*name)
 {
-    vlc_object_t *parent = (vlc_object_t *) wnd;
+    vlc_object_t *parent = VLC_OBJECT(wnd);
     struct vlc_vk_platform_t *vk;
 
     vk = vlc_object_create(parent, sizeof (*vk));


=====================================
src/video_output/video_window.c
=====================================
@@ -400,7 +400,7 @@ vlc_window_t *vout_display_window_New(vout_thread_t *vout)
     var_Create(vout, "window-fullscreen", VLC_VAR_BOOL);
     var_Create(vout, "window-fullscreen-output", VLC_VAR_STRING);
 
-    window = vlc_window_New((vlc_object_t *)vout, modlist, &owner, &cfg);
+    window = vlc_window_New(VLC_OBJECT(vout), modlist, &owner, &cfg);
     free(modlist);
     if (window == NULL)
         free(state);



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/ddcc2cdcff84e6a83a4dfe581fddde6f524877aa...18a0616fb93c91a40457484231f4009f122a71c0

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/ddcc2cdcff84e6a83a4dfe581fddde6f524877aa...18a0616fb93c91a40457484231f4009f122a71c0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to