Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
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
ffmpeg
Commits
7ebeef6a
Commit
7ebeef6a
authored
Sep 05, 2021
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mlpdec: fix time_base for packet timestamps
parent
5d92b73c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
3 deletions
+40
-3
mlpdec.c
libavformat/mlpdec.c
+40
-3
No files found.
libavformat/mlpdec.c
View file @
7ebeef6a
...
...
@@ -22,8 +22,12 @@
*/
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "rawdec.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/mlp.h"
#include "libavcodec/mlp_parse.h"
static
int
av_always_inline
mlp_thd_probe
(
const
AVProbeData
*
p
,
uint32_t
sync
)
{
...
...
@@ -50,6 +54,40 @@ static int av_always_inline mlp_thd_probe(const AVProbeData *p, uint32_t sync)
return
0
;
}
static
int
mlp_read_header
(
AVFormatContext
*
s
)
{
int
ret
=
ff_raw_audio_read_header
(
s
);
if
(
ret
<
0
)
return
ret
;
ret
=
ffio_ensure_seekback
(
s
->
pb
,
10
);
if
(
ret
==
0
)
{
uint8_t
buffer
[
10
];
int
read
,
sample_rate
=
0
;
read
=
avio_read
(
s
->
pb
,
buffer
,
10
);
if
(
read
==
10
)
{
switch
(
buffer
[
7
])
{
case
SYNC_TRUEHD
:
sample_rate
=
mlp_samplerate
(
buffer
[
8
]
>>
4
);
break
;
case
SYNC_MLP
:
sample_rate
=
mlp_samplerate
(
buffer
[
9
]
>>
4
);
break
;
}
if
(
sample_rate
)
avpriv_set_pts_info
(
s
->
streams
[
0
],
64
,
1
,
sample_rate
);
}
if
(
read
>
0
)
avio_seek
(
s
->
pb
,
-
read
,
SEEK_CUR
);
}
return
0
;
}
#if CONFIG_MLP_DEMUXER
static
int
mlp_probe
(
const
AVProbeData
*
p
)
{
...
...
@@ -60,7 +98,7 @@ const AVInputFormat ff_mlp_demuxer = {
.
name
=
"mlp"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw MLP"
),
.
read_probe
=
mlp_probe
,
.
read_header
=
ff_raw_audio
_read_header
,
.
read_header
=
mlp
_read_header
,
.
read_packet
=
ff_raw_read_partial_packet
,
.
flags
=
AVFMT_GENERIC_INDEX
|
AVFMT_NOTIMESTAMPS
,
.
extensions
=
"mlp"
,
...
...
@@ -80,7 +118,7 @@ const AVInputFormat ff_truehd_demuxer = {
.
name
=
"truehd"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw TrueHD"
),
.
read_probe
=
thd_probe
,
.
read_header
=
ff_raw_audio
_read_header
,
.
read_header
=
mlp
_read_header
,
.
read_packet
=
ff_raw_read_partial_packet
,
.
flags
=
AVFMT_GENERIC_INDEX
|
AVFMT_NOTIMESTAMPS
,
.
extensions
=
"thd"
,
...
...
@@ -89,4 +127,3 @@ const AVInputFormat ff_truehd_demuxer = {
.
priv_class
=
&
ff_raw_demuxer_class
,
};
#endif
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