Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a07b19d9
Commit
a07b19d9
authored
Apr 04, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/vivo: set packet duration
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
b4305d60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
vivo.c
libavformat/vivo.c
+6
-1
No files found.
libavformat/vivo.c
View file @
a07b19d9
...
...
@@ -36,6 +36,7 @@ typedef struct VivoContext {
int
type
;
int
sequence
;
int
length
;
int
duration
;
uint8_t
text
[
1024
+
1
];
}
VivoContext
;
...
...
@@ -237,6 +238,7 @@ static int vivo_read_header(AVFormatContext *s)
ast
->
codecpar
->
bits_per_coded_sample
=
16
;
ast
->
codecpar
->
block_align
=
40
;
ast
->
codecpar
->
bit_rate
=
6400
;
vivo
->
duration
=
320
;
}
ast
->
start_time
=
0
;
...
...
@@ -252,7 +254,7 @@ static int vivo_read_packet(AVFormatContext *s, AVPacket *pkt)
VivoContext
*
vivo
=
s
->
priv_data
;
AVIOContext
*
pb
=
s
->
pb
;
unsigned
old_sequence
=
vivo
->
sequence
,
old_type
=
vivo
->
type
;
int
stream_index
,
ret
=
0
;
int
stream_index
,
duration
,
ret
=
0
;
restart:
...
...
@@ -268,10 +270,12 @@ restart:
case
1
:
case
2
:
// video
stream_index
=
0
;
duration
=
1
;
break
;
case
3
:
case
4
:
// audio
stream_index
=
1
;
duration
=
vivo
->
duration
;
break
;
default:
av_log
(
s
,
AV_LOG_ERROR
,
"unknown packet type %d
\n
"
,
vivo
->
type
);
...
...
@@ -300,6 +304,7 @@ restart:
}
pkt
->
stream_index
=
stream_index
;
pkt
->
duration
=
duration
;
return
ret
;
}
...
...
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