Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
f7e20464
Commit
f7e20464
authored
Apr 27, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fclose mpegts stuff properly.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
5233e4c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
testmpegts.cc
src/testmpegts.cc
+19
-0
No files found.
src/testmpegts.cc
View file @
f7e20464
...
@@ -27,6 +27,21 @@ using std::string;
...
@@ -27,6 +27,21 @@ using std::string;
using
std
::
vector
;
using
std
::
vector
;
using
std
::
regex
;
using
std
::
regex
;
class
ScopedFile
{
FILE
*
m_file
;
public
:
ScopedFile
(
FILE
*
f
)
:
m_file
(
f
)
{
}
~
ScopedFile
()
{
if
(
m_file
)
fclose
(
m_file
);
}
};
class
TSPacket
class
TSPacket
{
{
public
:
public
:
...
@@ -119,6 +134,8 @@ ts_append (const string& inname, const string& outname, const string& dataname)
...
@@ -119,6 +134,8 @@ ts_append (const string& inname, const string& outname, const string& dataname)
{
{
FILE
*
infile
=
fopen
(
inname
.
c_str
(),
"r"
);
FILE
*
infile
=
fopen
(
inname
.
c_str
(),
"r"
);
FILE
*
outfile
=
fopen
(
outname
.
c_str
(),
"w"
);
FILE
*
outfile
=
fopen
(
outname
.
c_str
(),
"w"
);
ScopedFile
infile_s
(
infile
);
ScopedFile
outfile_s
(
outfile
);
while
(
!
feof
(
infile
))
while
(
!
feof
(
infile
))
{
{
...
@@ -137,6 +154,7 @@ ts_append (const string& inname, const string& outname, const string& dataname)
...
@@ -137,6 +154,7 @@ ts_append (const string& inname, const string& outname, const string& dataname)
}
}
vector
<
unsigned
char
>
data
;
vector
<
unsigned
char
>
data
;
FILE
*
datafile
=
fopen
(
dataname
.
c_str
(),
"r"
);
FILE
*
datafile
=
fopen
(
dataname
.
c_str
(),
"r"
);
ScopedFile
datafile_s
(
datafile
);
int
c
;
int
c
;
while
((
c
=
fgetc
(
datafile
))
>=
0
)
while
((
c
=
fgetc
(
datafile
))
>=
0
)
data
.
push_back
(
c
);
data
.
push_back
(
c
);
...
@@ -223,6 +241,7 @@ Error
...
@@ -223,6 +241,7 @@ Error
TSReader
::
load
(
const
string
&
inname
)
TSReader
::
load
(
const
string
&
inname
)
{
{
FILE
*
infile
=
fopen
(
inname
.
c_str
(),
"r"
);
FILE
*
infile
=
fopen
(
inname
.
c_str
(),
"r"
);
ScopedFile
infile_s
(
infile
);
vector
<
unsigned
char
>
awmk_stream
;
vector
<
unsigned
char
>
awmk_stream
;
Header
header
;
Header
header
;
...
...
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