Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
456
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
cc646df5
Commit
cc646df5
authored
5 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
demux: hls: set ID3 time offset
callback lost or disabled ?
parent
9e7c2b59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/demux/hls/HLSStreams.cpp
+18
-17
18 additions, 17 deletions
modules/demux/hls/HLSStreams.cpp
modules/demux/hls/HLSStreams.hpp
+2
-1
2 additions, 1 deletion
modules/demux/hls/HLSStreams.hpp
with
20 additions
and
18 deletions
modules/demux/hls/HLSStreams.cpp
+
18
−
17
View file @
cc646df5
...
...
@@ -49,24 +49,27 @@ HLSStream::~HLSStream()
vlc_meta_Delete
(
p_meta
);
}
void
HLSStream
::
setTimeOffset
(
vlc_tick_t
i_offset
)
void
HLSStream
::
set
Metadata
TimeOffset
(
vlc_tick_t
i_offset
)
{
if
(
i_offset
>=
0
)
{
if
((
unsigned
)
format
==
StreamFormat
::
PACKEDAAC
)
{
if
(
!
b_id3_timestamps_offset_set
)
{
fakeEsOut
()
->
setAssociatedTimestamp
(
i_offset
);
}
return
;
}
if
(
!
b_id3_timestamps_offset_set
)
fakeEsOut
()
->
setAssociatedTimestamp
(
i_offset
);
b_id3_timestamps_offset_set
=
true
;
}
else
{
fakeEsOut
()
->
setAssociatedTimestamp
(
-
1
);
b_id3_timestamps_offset_set
=
false
;
}
AbstractStream
::
setTimeOffset
(
i_offset
);
}
bool
HLSStream
::
setPosition
(
vlc_tick_t
ts
,
bool
b
)
{
bool
ok
=
AbstractStream
::
setPosition
(
ts
,
b
);
if
(
b
&&
ok
)
b_id3_timestamps_offset_set
=
false
;
return
ok
;
}
int
HLSStream
::
ParseID3PrivTag
(
const
uint8_t
*
p_payload
,
size_t
i_payload
)
...
...
@@ -74,19 +77,17 @@ int HLSStream::ParseID3PrivTag(const uint8_t *p_payload, size_t i_payload)
if
(
i_payload
==
53
&&
!
memcmp
(
p_payload
,
"com.apple.streaming.transportStreamTimestamp"
,
45
))
{
if
(
!
b_id3_timestamps_offset_set
)
{
const
vlc_tick_t
i_aac_offset
=
FROM_SCALE_NZ
(
GetQWBE
(
&
p_payload
[
45
]));
setTimeOffset
(
i_aac_offset
);
b_id3_timestamps_offset_set
=
true
;
}
setMetadataTimeOffset
(
FROM_SCALE_NZ
(
GetQWBE
(
&
p_payload
[
45
])));
}
return
VLC_SUCCESS
;
}
int
HLSStream
::
ParseID3Tag
(
uint32_t
i_tag
,
const
uint8_t
*
p_payload
,
size_t
i_payload
)
{
(
void
)
ID3HandleTag
(
p_payload
,
i_payload
,
i_tag
,
p_meta
,
&
b_meta_updated
);
if
(
i_tag
==
VLC_FOURCC
(
'P'
,
'R'
,
'I'
,
'V'
))
(
void
)
ParseID3PrivTag
(
p_payload
,
i_payload
);
else
(
void
)
ID3HandleTag
(
p_payload
,
i_payload
,
i_tag
,
p_meta
,
&
b_meta_updated
);
return
VLC_SUCCESS
;
}
...
...
This diff is collapsed.
Click to expand it.
modules/demux/hls/HLSStreams.hpp
+
2
−
1
View file @
cc646df5
...
...
@@ -33,15 +33,16 @@ namespace hls
virtual
~
HLSStream
();
protected:
virtual
void
setTimeOffset
(
vlc_tick_t
);
/* reimpl */
virtual
block_t
*
checkBlock
(
block_t
*
,
bool
);
/* reimpl */
virtual
AbstractDemuxer
*
newDemux
(
demux_t
*
,
const
StreamFormat
&
,
es_out_t
*
,
AbstractSourceStream
*
)
const
;
/* reimpl */
virtual
bool
setPosition
(
vlc_tick_t
,
bool
);
private:
static
int
ID3TAG_Parse_Handler
(
uint32_t
,
const
uint8_t
*
,
size_t
,
void
*
);
int
ParseID3Tag
(
uint32_t
,
const
uint8_t
*
,
size_t
);
int
ParseID3PrivTag
(
const
uint8_t
*
,
size_t
);
void
setMetadataTimeOffset
(
vlc_tick_t
);
bool
b_id3_timestamps_offset_set
;
vlc_meta_t
*
p_meta
;
bool
b_meta_updated
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment