mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-09 14:07:31 +02:00
avformat/asfdec: dvrms timestamps are pts not dts
Should fix Ticket3328 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8202c49b43
commit
4eb13cdfb0
@ -69,6 +69,7 @@ typedef struct {
|
|||||||
unsigned int packet_frag_offset;
|
unsigned int packet_frag_offset;
|
||||||
unsigned int packet_frag_size;
|
unsigned int packet_frag_size;
|
||||||
int64_t packet_frag_timestamp;
|
int64_t packet_frag_timestamp;
|
||||||
|
int ts_is_pts;
|
||||||
int packet_multi_size;
|
int packet_multi_size;
|
||||||
int packet_time_delta;
|
int packet_time_delta;
|
||||||
int packet_time_start;
|
int packet_time_start;
|
||||||
@ -1053,6 +1054,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb)
|
|||||||
ts1 = avio_rl64(pb);
|
ts1 = avio_rl64(pb);
|
||||||
if (ts0!= -1) asf->packet_frag_timestamp = ts0/10000;
|
if (ts0!= -1) asf->packet_frag_timestamp = ts0/10000;
|
||||||
else asf->packet_frag_timestamp = AV_NOPTS_VALUE;
|
else asf->packet_frag_timestamp = AV_NOPTS_VALUE;
|
||||||
|
asf->ts_is_pts = 1;
|
||||||
break;
|
break;
|
||||||
case 0x5B:
|
case 0x5B:
|
||||||
case 0xB7:
|
case 0xB7:
|
||||||
@ -1203,6 +1205,9 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
|
|||||||
/* new packet */
|
/* new packet */
|
||||||
av_new_packet(&asf_st->pkt, asf_st->packet_obj_size);
|
av_new_packet(&asf_st->pkt, asf_st->packet_obj_size);
|
||||||
asf_st->seq = asf->packet_seq;
|
asf_st->seq = asf->packet_seq;
|
||||||
|
if (asf->ts_is_pts) {
|
||||||
|
asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;
|
||||||
|
} else
|
||||||
asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
|
asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
|
||||||
asf_st->pkt.stream_index = asf->stream_index;
|
asf_st->pkt.stream_index = asf->stream_index;
|
||||||
asf_st->pkt.pos = asf_st->packet_pos = asf->packet_pos;
|
asf_st->pkt.pos = asf_st->packet_pos = asf->packet_pos;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user