Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
647ff1a2
Commit
647ff1a2
authored
Feb 01, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interaction: remove (buggy and useless) dialog IDs
parent
14e329dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
96 deletions
+51
-96
include/vlc_interface.h
include/vlc_interface.h
+4
-5
modules/access/dvb/scan.c
modules/access/dvb/scan.c
+7
-7
modules/access/dvb/scan.h
modules/access/dvb/scan.h
+1
-1
modules/demux/avi/avi.c
modules/demux/avi/avi.c
+7
-8
src/interface/interaction.c
src/interface/interaction.c
+23
-66
src/misc/update.c
src/misc/update.c
+9
-9
No files found.
include/vlc_interface.h
View file @
647ff1a2
...
...
@@ -200,7 +200,6 @@ typedef enum vlc_dialog {
*/
struct
interaction_dialog_t
{
int
i_id
;
///< Unique ID
int
i_type
;
///< Type identifier
char
*
psz_title
;
///< Title
char
*
psz_description
;
///< Descriptor string
...
...
@@ -294,13 +293,13 @@ VLC_EXPORT( int, __intf_UserStringInput,(vlc_object_t*, const char*, const char*
#define intf_IntfProgress( a, b, c ) __intf_Progress( VLC_OBJECT(a), NULL, b,c, -1 )
#define intf_UserProgress( a, b, c, d, e ) __intf_Progress( VLC_OBJECT(a),b,c,d,e )
VLC_EXPORT
(
int
,
__intf_Progress
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
float
,
int
)
);
VLC_EXPORT
(
int
eraction_dialog_t
*
,
__intf_Progress
,(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
float
,
int
)
);
#define intf_ProgressUpdate( a, b, c, d, e ) __intf_ProgressUpdate( VLC_OBJECT(a),b,c,d,e )
VLC_EXPORT
(
void
,
__intf_ProgressUpdate
,(
vlc_object_t
*
,
int
,
const
char
*
,
float
,
int
)
);
VLC_EXPORT
(
void
,
__intf_ProgressUpdate
,(
vlc_object_t
*
,
int
eraction_dialog_t
*
,
const
char
*
,
float
,
int
)
);
#define intf_ProgressIsCancelled( a, b ) __intf_UserProgressIsCancelled( VLC_OBJECT(a),b )
VLC_EXPORT
(
bool
,
__intf_UserProgressIsCancelled
,(
vlc_object_t
*
,
int
)
);
VLC_EXPORT
(
bool
,
__intf_UserProgressIsCancelled
,(
vlc_object_t
*
,
int
eraction_dialog_t
*
)
);
#define intf_UserHide( a, b ) __intf_UserHide( VLC_OBJECT(a), b )
VLC_EXPORT
(
void
,
__intf_UserHide
,(
vlc_object_t
*
,
int
));
VLC_EXPORT
(
void
,
__intf_UserHide
,(
vlc_object_t
*
,
int
eraction_dialog_t
*
));
/** @} */
/** @} */
...
...
modules/access/dvb/scan.c
View file @
647ff1a2
...
...
@@ -126,7 +126,7 @@ int scan_Init( vlc_object_t *p_obj, scan_t *p_scan, const scan_parameter_t *p_pa
p_scan
->
p_obj
=
VLC_OBJECT
(
p_obj
);
p_scan
->
i_index
=
0
;
p_scan
->
i_dialog_id
=
-
1
;
p_scan
->
p_dialog
=
NULL
;
TAB_INIT
(
p_scan
->
i_service
,
p_scan
->
pp_service
);
p_scan
->
parameter
=
*
p_parameter
;
p_scan
->
i_time_start
=
mdate
();
...
...
@@ -135,8 +135,8 @@ int scan_Init( vlc_object_t *p_obj, scan_t *p_scan, const scan_parameter_t *p_pa
}
void
scan_Clean
(
scan_t
*
p_scan
)
{
if
(
p_scan
->
i_dialog_id
>=
0
)
intf_UserHide
(
p_scan
->
p_obj
,
p_scan
->
i_dialog_id
);
if
(
p_scan
->
p_dialog
!=
NULL
)
intf_UserHide
(
p_scan
->
p_obj
,
p_scan
->
p_dialog
);
for
(
int
i
=
0
;
i
<
p_scan
->
i_service
;
i
++
)
scan_service_Delete
(
p_scan
->
pp_service
[
i
]
);
...
...
@@ -317,10 +317,10 @@ int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg )
if
(
i_eta
>=
0
)
msg_Info
(
p_scan
->
p_obj
,
"Scan ETA %s | %f"
,
secstotimestr
(
psz_eta
,
i_eta
/
1000000
),
f_position
*
100
);
if
(
p_scan
->
i_dialog_id
<
0
)
p_scan
->
i_dialog_id
=
intf_UserProgress
(
p_scan
->
p_obj
,
_
(
"Scanning DVB-T"
),
psz_text
,
100
.
0
*
f_position
,
-
1
);
if
(
p_scan
->
p_dialog
==
NULL
)
p_scan
->
p_dialog
=
intf_UserProgress
(
p_scan
->
p_obj
,
_
(
"Scanning DVB-T"
),
psz_text
,
100
.
0
*
f_position
,
-
1
);
else
intf_ProgressUpdate
(
p_scan
->
p_obj
,
p_scan
->
i_dialog_id
,
psz_text
,
100
*
f_position
,
-
1
);
intf_ProgressUpdate
(
p_scan
->
p_obj
,
p_scan
->
p_dialog
,
psz_text
,
100
*
f_position
,
-
1
);
free
(
psz_text
);
}
...
...
@@ -330,7 +330,7 @@ int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg )
bool
scan_IsCancelled
(
scan_t
*
p_scan
)
{
return
p_scan
->
i_dialog_id
>=
0
&&
intf_ProgressIsCancelled
(
p_scan
->
p_obj
,
p_scan
->
i_dialog_id
);
return
p_scan
->
p_dialog
&&
intf_ProgressIsCancelled
(
p_scan
->
p_obj
,
p_scan
->
p_dialog
);
}
static
scan_service_t
*
ScanFindService
(
scan_t
*
p_scan
,
int
i_service_start
,
int
i_program
)
...
...
modules/access/dvb/scan.h
View file @
647ff1a2
...
...
@@ -127,8 +127,8 @@ typedef struct
typedef
struct
{
vlc_object_t
*
p_obj
;
interaction_dialog_t
*
p_dialog
;
int64_t
i_index
;
int
i_dialog_id
;
scan_parameter_t
parameter
;
int64_t
i_time_start
;
...
...
modules/demux/avi/avi.c
View file @
647ff1a2
...
...
@@ -2375,7 +2375,7 @@ static void AVI_IndexCreate( demux_t *p_demux )
off_t
i_movi_end
;
mtime_t
i_dialog_update
;
int
i_dialog_id
;
int
eraction_dialog_t
*
p_dialog
=
NULL
;
p_riff
=
AVI_ChunkFind
(
&
p_sys
->
ck_root
,
AVIFOURCC_RIFF
,
0
);
p_movi
=
AVI_ChunkFind
(
p_riff
,
AVIFOURCC_movi
,
0
);
...
...
@@ -2400,10 +2400,9 @@ static void AVI_IndexCreate( demux_t *p_demux )
/* Only show dialog if AVI is > 10MB */
i_dialog_id
=
-
1
;
i_dialog_update
=
mdate
();
if
(
stream_Size
(
p_demux
->
s
)
>
10000000
)
i_dialog_id
=
intf_IntfProgress
(
p_demux
,
_
(
"Fixing AVI Index..."
),
0
.
0
);
p_dialog
=
intf_IntfProgress
(
p_demux
,
_
(
"Fixing AVI Index..."
),
0
.
0
);
for
(
;;
)
{
...
...
@@ -2413,14 +2412,14 @@ static void AVI_IndexCreate( demux_t *p_demux )
break
;
/* Don't update/check dialog too often */
if
(
i_dialog_id
>
0
&&
mdate
()
-
i_dialog_update
>
100000
)
if
(
p_dialog
&&
mdate
()
-
i_dialog_update
>
100000
)
{
if
(
intf_ProgressIsCancelled
(
p_demux
,
i_dialog_id
)
)
if
(
intf_ProgressIsCancelled
(
p_demux
,
p_dialog
)
)
break
;
double
f_pos
=
100
.
0
*
stream_Tell
(
p_demux
->
s
)
/
stream_Size
(
p_demux
->
s
);
intf_ProgressUpdate
(
p_demux
,
i_dialog_id
,
intf_ProgressUpdate
(
p_demux
,
p_dialog
,
_
(
"Fixing AVI Index..."
),
f_pos
,
-
1
);
i_dialog_update
=
mdate
();
...
...
@@ -2484,8 +2483,8 @@ static void AVI_IndexCreate( demux_t *p_demux )
}
print_stat:
if
(
i_dialog_id
>
0
)
intf_UserHide
(
p_demux
,
i_dialog_id
);
if
(
p_dialog
!=
NULL
)
intf_UserHide
(
p_demux
,
p_dialog
);
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_track
;
i_stream
++
)
{
...
...
src/interface/interaction.c
View file @
647ff1a2
...
...
@@ -69,13 +69,12 @@ static intf_thread_t * SearchInterface( interaction_t * );
static
void
*
InteractionLoop
(
void
*
);
static
void
InteractionManage
(
interaction_t
*
);
static
interaction_dialog_t
*
DialogGetById
(
interaction_t
*
,
int
);
static
void
DialogDestroy
(
interaction_dialog_t
*
);
static
int
DialogSend
(
vlc_object_t
*
,
interaction_dialog_t
*
);
#define DIALOG_INIT( type ) \
#define DIALOG_INIT( type
, err
) \
interaction_dialog_t* p_new = calloc( 1, sizeof( interaction_dialog_t ) ); \
if( !p_new ) return
VLC_EGENERIC;
\
if( !p_new ) return
err;
\
p_new->b_cancelled = false; \
p_new->i_status = NEW_DIALOG; \
p_new->i_flags = 0; \
...
...
@@ -103,7 +102,7 @@ int __intf_UserFatal( vlc_object_t *p_this, bool b_blocking,
const
char
*
psz_format
,
...
)
{
va_list
args
;
DIALOG_INIT
(
ONEWAY
);
DIALOG_INIT
(
ONEWAY
,
VLC_EGENERIC
);
p_new
->
psz_title
=
strdup
(
psz_title
);
FORMAT_DESC
;
...
...
@@ -129,7 +128,7 @@ int __intf_UserWarn( vlc_object_t *p_this,
const
char
*
psz_format
,
...
)
{
va_list
args
;
DIALOG_INIT
(
ONEWAY
);
DIALOG_INIT
(
ONEWAY
,
VLC_EGENERIC
);
p_new
->
psz_title
=
strdup
(
psz_title
);
FORMAT_DESC
;
...
...
@@ -157,7 +156,7 @@ int __intf_UserYesNo( vlc_object_t *p_this,
const
char
*
psz_alternate
,
const
char
*
psz_other
)
{
DIALOG_INIT
(
TWOWAY
);
DIALOG_INIT
(
TWOWAY
,
VLC_EGENERIC
);
p_new
->
psz_title
=
strdup
(
psz_title
);
p_new
->
psz_description
=
strdup
(
psz_description
);
...
...
@@ -178,12 +177,13 @@ int __intf_UserYesNo( vlc_object_t *p_this,
* \param psz_status Current status
* \param f_position Current position (0.0->100.0)
* \param i_timeToGo Time (in sec) to go until process is finished
* \return Dialog
id, to give to
UserProgressUpdate
* \return Dialog
, for use with
UserProgressUpdate
*/
int
__intf_Progress
(
vlc_object_t
*
p_this
,
const
char
*
psz_title
,
interaction_dialog_t
*
__intf_Progress
(
vlc_object_t
*
p_this
,
const
char
*
psz_title
,
const
char
*
psz_status
,
float
f_pos
,
int
i_time
)
{
DIALOG_INIT
(
ONEWAY
);
DIALOG_INIT
(
ONEWAY
,
NULL
);
p_new
->
psz_description
=
strdup
(
psz_status
);
p_new
->
val
.
f_float
=
f_pos
;
p_new
->
i_timeToGo
=
i_time
;
...
...
@@ -198,37 +198,28 @@ int __intf_Progress( vlc_object_t *p_this, const char *psz_title,
p_new
->
i_flags
=
DIALOG_INTF_PROGRESS
;
DialogSend
(
p_this
,
p_new
);
return
p_new
->
i_id
;
return
p_new
;
}
/**
* Update a progress bar in a dialogue
*
* \param p_this Parent vlc_object
* \param
i_id Identifier of the d
ialog
* \param
p_dialog D
ialog
* \param psz_status New status
* \param f_position New position (0.0->100.0)
* \param i_timeToGo Time (in sec) to go until process is finished
* \return nothing
*/
void
__intf_ProgressUpdate
(
vlc_object_t
*
p_this
,
int
i_id
,
void
__intf_ProgressUpdate
(
vlc_object_t
*
p_this
,
interaction_dialog_t
*
p_dialog
,
const
char
*
psz_status
,
float
f_pos
,
int
i_time
)
{
interaction_t
*
p_interaction
=
InteractionGet
(
p_this
);
interaction_dialog_t
*
p_dialog
;
if
(
!
p_interaction
)
return
;
vlc_object_lock
(
p_interaction
);
p_dialog
=
DialogGetById
(
p_interaction
,
i_id
);
if
(
!
p_dialog
)
{
vlc_object_unlock
(
p_interaction
);
vlc_object_release
(
p_interaction
);
return
;
}
free
(
p_dialog
->
psz_description
);
p_dialog
->
psz_description
=
strdup
(
psz_status
);
...
...
@@ -247,26 +238,18 @@ void __intf_ProgressUpdate( vlc_object_t *p_this, int i_id,
* interface module and the caller
*
* \param p_this Parent vlc_object
* \param
i_id Identifier of the dialogue
* \param
p_dialog Dialog
* \return Either true or false
*/
bool
__intf_UserProgressIsCancelled
(
vlc_object_t
*
p_this
,
int
i_id
)
bool
__intf_UserProgressIsCancelled
(
vlc_object_t
*
p_this
,
interaction_dialog_t
*
p_dialog
)
{
interaction_t
*
p_interaction
=
InteractionGet
(
p_this
);
interaction_dialog_t
*
p_dialog
;
bool
b_cancel
;
if
(
!
p_interaction
)
return
true
;
vlc_object_lock
(
p_interaction
);
p_dialog
=
DialogGetById
(
p_interaction
,
i_id
);
if
(
!
p_dialog
)
{
vlc_object_unlock
(
p_interaction
)
;
vlc_object_release
(
p_interaction
);
return
true
;
}
b_cancel
=
p_dialog
->
b_cancelled
;
vlc_object_unlock
(
p_interaction
);
vlc_object_release
(
p_interaction
);
...
...
@@ -290,7 +273,7 @@ int __intf_UserLoginPassword( vlc_object_t *p_this,
char
**
ppsz_password
)
{
int
i_ret
;
DIALOG_INIT
(
TWOWAY
);
DIALOG_INIT
(
TWOWAY
,
VLC_EGENERIC
);
p_new
->
i_type
=
INTERACT_DIALOG_TWOWAY
;
p_new
->
psz_title
=
strdup
(
psz_title
);
p_new
->
psz_description
=
strdup
(
psz_description
);
...
...
@@ -326,7 +309,7 @@ int __intf_UserStringInput( vlc_object_t *p_this,
char
**
ppsz_usersString
)
{
int
i_ret
;
DIALOG_INIT
(
TWOWAY
);
DIALOG_INIT
(
TWOWAY
,
VLC_EGENERIC
);
p_new
->
i_type
=
INTERACT_DIALOG_TWOWAY
;
p_new
->
psz_title
=
strdup
(
psz_title
);
p_new
->
psz_description
=
strdup
(
psz_description
);
...
...
@@ -347,25 +330,18 @@ int __intf_UserStringInput( vlc_object_t *p_this,
* Hide an interaction dialog
*
* \param p_this the parent vlc object
* \param
i_id the id of the item
to hide
* \param
p_dialog the dialog
to hide
* \return nothing
*/
void
__intf_UserHide
(
vlc_object_t
*
p_this
,
int
i_id
)
void
__intf_UserHide
(
vlc_object_t
*
p_this
,
int
eraction_dialog_t
*
p_dialog
)
{
interaction_t
*
p_interaction
=
InteractionGet
(
p_this
);
interaction_dialog_t
*
p_dialog
;
if
(
!
p_interaction
)
return
;
vlc_object_lock
(
p_interaction
);
p_dialog
=
DialogGetById
(
p_interaction
,
i_id
);
if
(
p_dialog
)
{
p_dialog
->
i_status
=
ANSWERED_DIALOG
;
vlc_cond_signal
(
&
p_interaction
->
wait
);
}
p_dialog
->
i_status
=
ANSWERED_DIALOG
;
vlc_cond_signal
(
&
p_interaction
->
wait
);
vlc_object_unlock
(
p_interaction
);
vlc_object_release
(
p_interaction
);
}
...
...
@@ -491,19 +467,6 @@ static intf_thread_t *SearchInterface( interaction_t *p_interaction )
return
intf
;
}
/* Find an interaction dialog by its id */
static
interaction_dialog_t
*
DialogGetById
(
interaction_t
*
p_interaction
,
int
i_id
)
{
int
i
;
for
(
i
=
0
;
i
<
p_interaction
->
i_dialogs
;
i
++
)
{
if
(
p_interaction
->
pp_dialogs
[
i
]
->
i_id
==
i_id
)
return
p_interaction
->
pp_dialogs
[
i
];
}
return
NULL
;
}
/* Destroy a dialog */
static
void
DialogDestroy
(
interaction_dialog_t
*
p_dialog
)
{
...
...
@@ -524,12 +487,6 @@ static int DialogSend( vlc_object_t *p_this, interaction_dialog_t *p_dialog )
if
(
!
p_interaction
)
return
VLC_EGENERIC
;
/* Get an id, if we don't already have one */
vlc_object_lock
(
p_interaction
);
if
(
p_dialog
->
i_id
==
0
)
p_dialog
->
i_id
=
++
p_interaction
->
i_last_id
;
vlc_object_unlock
(
p_interaction
);
if
(
p_this
->
i_flags
&
OBJECT_FLAGS_NOINTERACT
)
{
vlc_object_release
(
p_interaction
);
...
...
@@ -549,7 +506,7 @@ static int DialogSend( vlc_object_t *p_this, interaction_dialog_t *p_dialog )
vlc_object_lock
(
p_interaction
);
for
(
i
=
0
;
i
<
p_interaction
->
i_dialogs
;
i
++
)
{
if
(
p_interaction
->
pp_dialogs
[
i
]
->
i_id
==
p_dialog
->
i_id
)
if
(
p_interaction
->
pp_dialogs
[
i
]
==
p_dialog
)
b_found
=
true
;
}
/* Add it to the queue, the main loop will send the orders to the
...
...
src/misc/update.c
View file @
647ff1a2
...
...
@@ -1511,7 +1511,7 @@ void update_Download( update_t *p_update, const char *destination )
static
void
*
update_DownloadReal
(
vlc_object_t
*
p_this
)
{
update_download_thread_t
*
p_udt
=
(
update_download_thread_t
*
)
p_this
;
int
i
_progress
=
0
;
int
eraction_dialog_t
*
p
_progress
=
0
;
long
int
l_size
;
long
int
l_downloaded
=
0
;
float
f_progress
;
...
...
@@ -1589,7 +1589,7 @@ static void* update_DownloadReal( vlc_object_t *p_this )
if
(
asprintf
(
&
psz_status
,
_
(
"%s
\n
Downloading... %s/%s %.1f%% done"
),
p_update
->
release
.
psz_url
,
"0.0"
,
psz_size
,
0
.
0
)
!=
-
1
)
{
i
_progress
=
intf_UserProgress
(
p_udt
,
_
(
"Downloading ..."
),
p
_progress
=
intf_UserProgress
(
p_udt
,
_
(
"Downloading ..."
),
psz_status
,
0
.
0
,
0
);
free
(
psz_status
);
}
...
...
@@ -1597,7 +1597,7 @@ static void* update_DownloadReal( vlc_object_t *p_this )
vlc_object_lock
(
p_udt
);
while
(
vlc_object_alive
(
p_udt
)
&&
(
i_read
=
stream_Read
(
p_stream
,
p_buffer
,
1
<<
10
)
)
&&
!
intf_ProgressIsCancelled
(
p_udt
,
i
_progress
)
)
!
intf_ProgressIsCancelled
(
p_udt
,
p
_progress
)
)
{
vlc_object_unlock
(
p_udt
);
if
(
fwrite
(
p_buffer
,
i_read
,
1
,
p_file
)
<
1
)
...
...
@@ -1614,7 +1614,7 @@ static void* update_DownloadReal( vlc_object_t *p_this )
p_update
->
release
.
psz_url
,
psz_downloaded
,
psz_size
,
f_progress
)
!=
-
1
)
{
intf_ProgressUpdate
(
p_udt
,
i
_progress
,
psz_status
,
f_progress
,
0
);
intf_ProgressUpdate
(
p_udt
,
p
_progress
,
psz_status
,
f_progress
,
0
);
free
(
psz_status
);
}
free
(
psz_downloaded
);
...
...
@@ -1626,14 +1626,14 @@ static void* update_DownloadReal( vlc_object_t *p_this )
p_file
=
NULL
;
if
(
vlc_object_alive
(
p_udt
)
&&
!
intf_ProgressIsCancelled
(
p_udt
,
i
_progress
)
)
!
intf_ProgressIsCancelled
(
p_udt
,
p
_progress
)
)
{
vlc_object_unlock
(
p_udt
);
if
(
asprintf
(
&
psz_status
,
_
(
"%s
\n
Done %s (100.0%%)"
),
p_update
->
release
.
psz_url
,
psz_size
)
!=
-
1
)
{
intf_ProgressUpdate
(
p_udt
,
i
_progress
,
psz_status
,
100
.
0
,
0
);
i_progress
=
0
;
intf_ProgressUpdate
(
p_udt
,
p
_progress
,
psz_status
,
100
.
0
,
0
);
p_progress
=
NULL
free
(
psz_status
);
}
}
...
...
@@ -1723,9 +1723,9 @@ static void* update_DownloadReal( vlc_object_t *p_this )
free
(
p_hash
);
end:
if
(
i
_progress
)
if
(
p
_progress
)
{
intf_ProgressUpdate
(
p_udt
,
i
_progress
,
_
(
"Cancelled"
),
100
.
0
,
0
);
intf_ProgressUpdate
(
p_udt
,
p
_progress
,
_
(
"Cancelled"
),
100
.
0
,
0
);
}
if
(
p_stream
)
stream_Delete
(
p_stream
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment