aboutsummaryrefslogtreecommitdiff
path: root/lib/ffmpeg/libavcodec/flac_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ffmpeg/libavcodec/flac_parser.c')
-rw-r--r--lib/ffmpeg/libavcodec/flac_parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ffmpeg/libavcodec/flac_parser.c b/lib/ffmpeg/libavcodec/flac_parser.c
index e2c6744d78..0b7bf9b70c 100644
--- a/lib/ffmpeg/libavcodec/flac_parser.c
+++ b/lib/ffmpeg/libavcodec/flac_parser.c
@@ -468,6 +468,14 @@ static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
&fpc->wrap_buf,
&fpc->wrap_buf_allocated_size);
+
+ if (fpc->pc->flags & PARSER_FLAG_USE_CODEC_TS){
+ if (header->fi.is_var_size)
+ fpc->pc->pts = header->fi.frame_or_sample_num;
+ else if (header->best_child)
+ fpc->pc->pts = header->fi.frame_or_sample_num * header->fi.blocksize;
+ }
+
fpc->best_header_valid = 0;
/* Return the negative overread index so the client can compute pos.
This should be the amount overread to the beginning of the child */