Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
a47b7c7a
Commit
a47b7c7a
authored
Mar 17, 2010
by
Sébastien Escudier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File output : add a sync option
parent
9aa3dfae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
modules/access_output/file.c
modules/access_output/file.c
+10
-1
No files found.
modules/access_output/file.c
View file @
a47b7c7a
...
@@ -63,6 +63,8 @@ static void Close( vlc_object_t * );
...
@@ -63,6 +63,8 @@ static void Close( vlc_object_t * );
#define APPEND_TEXT N_("Append to file")
#define APPEND_TEXT N_("Append to file")
#define APPEND_LONGTEXT N_( "Append to file if it exists instead " \
#define APPEND_LONGTEXT N_( "Append to file if it exists instead " \
"of replacing it.")
"of replacing it.")
#define SYNC_TEXT N_("Synchronous writing")
#define SYNC_LONGTEXT N_( "Open the file with synchronous writing.")
vlc_module_begin
()
vlc_module_begin
()
set_description
(
N_
(
"File stream output"
)
)
set_description
(
N_
(
"File stream output"
)
)
...
@@ -74,6 +76,8 @@ vlc_module_begin ()
...
@@ -74,6 +76,8 @@ vlc_module_begin ()
add_shortcut
(
"stream"
)
add_shortcut
(
"stream"
)
add_bool
(
SOUT_CFG_PREFIX
"append"
,
false
,
NULL
,
APPEND_TEXT
,
APPEND_LONGTEXT
,
add_bool
(
SOUT_CFG_PREFIX
"append"
,
false
,
NULL
,
APPEND_TEXT
,
APPEND_LONGTEXT
,
true
)
true
)
add_bool
(
SOUT_CFG_PREFIX
"sync"
,
false
,
NULL
,
SYNC_TEXT
,
SYNC_LONGTEXT
,
false
)
set_callbacks
(
Open
,
Close
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
vlc_module_end
()
...
@@ -82,7 +86,7 @@ vlc_module_end ()
...
@@ -82,7 +86,7 @@ vlc_module_end ()
* Exported prototypes
* Exported prototypes
*****************************************************************************/
*****************************************************************************/
static
const
char
*
const
ppsz_sout_options
[]
=
{
static
const
char
*
const
ppsz_sout_options
[]
=
{
"append"
,
NULL
"append"
,
"sync"
,
NULL
};
};
static
ssize_t
Write
(
sout_access_out_t
*
,
block_t
*
);
static
ssize_t
Write
(
sout_access_out_t
*
,
block_t
*
);
...
@@ -102,6 +106,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -102,6 +106,7 @@ static int Open( vlc_object_t *p_this )
{
{
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
int
fd
;
int
fd
;
bool
sync
;
config_ChainParse
(
p_access
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
p_access
->
p_cfg
);
config_ChainParse
(
p_access
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
p_access
->
p_cfg
);
...
@@ -112,6 +117,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -112,6 +117,7 @@ static int Open( vlc_object_t *p_this )
}
}
bool
append
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"append"
);
bool
append
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"append"
);
sync
=
var_GetBool
(
p_access
,
SOUT_CFG_PREFIX
"sync"
);
if
(
!
strcmp
(
p_access
->
psz_path
,
"-"
)
)
if
(
!
strcmp
(
p_access
->
psz_path
,
"-"
)
)
{
{
...
@@ -132,6 +138,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -132,6 +138,9 @@ static int Open( vlc_object_t *p_this )
path_sanitize
(
psz_tmp
);
path_sanitize
(
psz_tmp
);
fd
=
vlc_open
(
psz_tmp
,
O_RDWR
|
O_CREAT
|
O_LARGEFILE
|
fd
=
vlc_open
(
psz_tmp
,
O_RDWR
|
O_CREAT
|
O_LARGEFILE
|
#ifdef O_SYNC
(
sync
?
O_SYNC
:
0
)
|
#endif
(
append
?
0
:
O_TRUNC
),
0666
);
(
append
?
0
:
O_TRUNC
),
0666
);
free
(
psz_tmp
);
free
(
psz_tmp
);
}
}
...
...
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