Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
38c415da
Commit
38c415da
authored
May 13, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bluray: use atomic_flag instead of vlc_gc_data
(This saves one function pointer.)
parent
cbbb1e49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
modules/access/bluray.c
modules/access/bluray.c
+11
-10
No files found.
modules/access/bluray.c
View file @
38c415da
...
...
@@ -36,6 +36,7 @@
#include <vlc_plugin.h>
#include <vlc_demux.h>
/* demux_t */
#include <vlc_input.h>
/* Seekpoints, chapters */
#include <vlc_atomic.h>
#include <vlc_dialog.h>
/* BD+/AACS warnings */
#include <vlc_vout.h>
/* vout_PutSubpicture / subpicture_t */
...
...
@@ -82,8 +83,7 @@ typedef enum OverlayStatus {
typedef
struct
bluray_overlay_t
{
VLC_GC_MEMBERS
atomic_flag
released_once
;
vlc_mutex_t
lock
;
subpicture_t
*
p_pic
;
OverlayStatus
status
;
...
...
@@ -563,9 +563,11 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
vlc_mutex_unlock
(
&
p_overlay
->
lock
);
}
static
void
blurayCleanOverlayStruct
(
bluray_overlay_t
*
);
static
void
subpictureUpdaterDestroy
(
subpicture_t
*
p_subpic
)
{
vlc_gc_decref
(
p_subpic
->
updater
.
p_sys
->
p_overlay
);
blurayCleanOverlayStruct
(
p_subpic
->
updater
.
p_sys
->
p_overlay
);
}
/*****************************************************************************
...
...
@@ -594,10 +596,10 @@ static int onMouseEvent(vlc_object_t *p_vout, const char *psz_var, vlc_value_t o
/*****************************************************************************
* libbluray overlay handling:
*****************************************************************************/
static
void
blurayCleanOver
ayStruct
(
gc_object_t
*
p_gc
)
static
void
blurayCleanOver
layStruct
(
bluray_overlay_t
*
p_overlay
)
{
bluray_overlay_t
*
p_overlay
=
vlc_priv
(
p_gc
,
bluray_overlay_t
);
if
(
!
atomic_flag_test_and_set
(
&
p_overlay
->
released_once
))
return
;
/*
* This will be called when destroying the picture.
* Don't delete it again from here!
...
...
@@ -617,7 +619,7 @@ static void blurayCloseAllOverlays(demux_t *p_demux)
if
(
p_sys
->
p_overlays
[
i
]
!=
NULL
)
{
vout_FlushSubpictureChannel
(
p_sys
->
p_vout
,
p_sys
->
p_overlays
[
i
]
->
p_pic
->
i_channel
);
vlc_gc_decref
(
p_sys
->
p_overlays
[
i
]);
blurayCleanOverlayStruct
(
p_sys
->
p_overlays
[
i
]);
p_sys
->
p_overlays
[
i
]
=
NULL
;
}
}
...
...
@@ -677,9 +679,8 @@ static void blurayInitOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
p_sys
->
p_overlays
[
ov
->
plane
]
=
NULL
;
return
;
}
vlc_gc_init
(
p_sys
->
p_overlays
[
ov
->
plane
],
blurayCleanOverayStruct
);
/* Incrementing refcounter: vout + demux */
vlc_gc_incref
(
p_sys
->
p_overlays
[
ov
->
plane
]);
/* two references: vout + demux */
p_sys
->
p_overlays
[
ov
->
plane
]
->
released_once
=
ATOMIC_FLAG_INIT
;
p_upd_sys
->
p_overlay
=
p_sys
->
p_overlays
[
ov
->
plane
];
subpicture_updater_t
updater
=
{
...
...
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