aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-04-04 20:23:23 +0200
committerPaul B Mahol <onemda@gmail.com>2020-02-20 14:41:26 +0100
commita07b19d9af6377beac5630cb49065ede426c4fee (patch)
tree1cbe72c5e31be7524aaa3adc553a62634d06be0f
parentb4305d60f68ade2601dbf238ae5a88d74d388f98 (diff)
downloadffmpeg-a07b19d9af6377beac5630cb49065ede426c4fee.tar.gz
avformat/vivo: set packet duration
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavformat/vivo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/vivo.c b/libavformat/vivo.c
index 2defda992b..fb58aa6178 100644
--- a/libavformat/vivo.c
+++ b/libavformat/vivo.c
@@ -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;
}