lavf: Replace the ASF demuxer

The old one is the result of the reverse engineering and guesswork.
The new one has been written following the now-available specification.

This work is part of Outreach Program for Women Summer 2014 activities
for the Libav project.

The fate references had to be changed because the old demuxer truncates
the last frame in some cases, the new one handles it properly.
The seek-test reference is changed because seeking works differently
in the new demuxer. When seeking, the packet is not read from the stream
directly, but it is rather constructed by the demuxer. That is why
position is -1 now in the reference.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Alexandra Hájková 2015-06-15 14:54:45 +02:00 committed by Anton Khirnov
parent 441e8ae5ef
commit b08569a239
7 changed files with 1511 additions and 1337 deletions

View File

@ -36,6 +36,7 @@ version <next>:
- Support the extended vp9 profiles in the libvpx wrapper
- Hap decoder and encoder
- DirectDraw Surface image/texture decoder
- rewritten ASF demuxer
version 11:

View File

@ -28,27 +28,6 @@
#define PACKET_SIZE 3200
typedef struct ASFStream {
int num;
unsigned char seq;
/* use for reading */
AVPacket pkt;
int frag_offset;
int timestamp;
int64_t duration;
int ds_span; /* descrambling */
int ds_packet_size;
int ds_chunk_size;
int64_t packet_pos;
uint16_t stream_language_index;
int palette_changed;
uint32_t palette[256];
} ASFStream;
typedef struct ASFMainHeader {
ff_asf_guid guid; ///< generated by client computer
uint64_t file_size; /**< in bytes

File diff suppressed because it is too large Load Diff

View File

@ -185,6 +185,27 @@
#define DATA_HEADER_SIZE 50
typedef struct ASFStream {
int num;
unsigned char seq;
/* use for reading */
AVPacket pkt;
int frag_offset;
int timestamp;
int64_t duration;
int ds_span; /* descrambling */
int ds_packet_size;
int ds_chunk_size;
int64_t packet_pos;
uint16_t stream_language_index;
int palette_changed;
uint32_t palette[256];
} ASFStream;
typedef struct ASFContext {
uint32_t seqno;
int is_streamed;

View File

@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR 20
#define LIBAVFORMAT_VERSION_MICRO 1
#define LIBAVFORMAT_VERSION_MINOR 21
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

View File

@ -146,7 +146,6 @@
0, 6666, 6666, 41, 1349, 0x02adaaf3
0, 6708, 6708, 41, 1464, 0x20d7cfd2
0, 6750, 6750, 41, 1377, 0x78e0b1f4
0, 6791, 6791, 41, 289, 0x1f2e9246
1, 6878, 6878, 0, 1088, 0x678f20fd
1, 7161, 7161, 0, 1088, 0x718afa20
1, 7444, 7444, 0, 1088, 0x758f0939

View File

@ -1,53 +1,53 @@
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208
ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st: 1 flags:1 dts: 0.261000 pts: 0.261000 pos: -1 size: 209
ret: 0 st:-1 flags:1 ts: 1.894167
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st: 0 flags:0 ts: 0.788000
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.732000 pts: 0.732000 pos: -1 size: 209
ret: 0 st: 0 flags:1 ts:-0.317000
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208
ret: 0 st: 1 flags:0 ts: 2.577000
ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st: 1 flags:1 ts: 1.471000
ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st:-1 flags:0 ts: 0.365002
ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st: 1 flags:1 dts: 0.261000 pts: 0.261000 pos: -1 size: 209
ret: 0 st:-1 flags:1 ts:-0.740831
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208
ret: 0 st: 0 flags:0 ts: 2.153000
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st: 0 flags:1 ts: 1.048000
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st: 1 flags:0 ts:-0.058000
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.261000 pts: 0.261000 pos: -1 size: 209
ret: 0 st: 1 flags:1 ts: 2.836000
ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st:-1 flags:0 ts: 1.730004
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st:-1 flags:1 ts: 0.624171
ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: -1 size: 209
ret: 0 st: 0 flags:0 ts:-0.482000
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208
ret: 0 st: 0 flags:1 ts: 2.413000
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.732000 pts: 0.732000 pos: -1 size: 209
ret: 0 st: 1 flags:0 ts: 1.307000
ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st: 1 flags:1 ts: 0.201000
ret: 0 st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos: 70979 size: 209
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208
ret: 0 st:-1 flags:0 ts:-0.904994
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208
ret: 0 st:-1 flags:1 ts: 1.989173
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st: 0 flags:0 ts: 0.883000
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:1 dts: 0.732000 pts: 0.732000 pos: -1 size: 209
ret: 0 st: 0 flags:1 ts:-0.222000
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208
ret: 0 st: 1 flags:0 ts: 2.672000
ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st: 1 flags:1 ts: 1.566000
ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: -1 size: 209
ret: 0 st:-1 flags:0 ts: 0.460008
ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st: 1 flags:1 dts: 0.261000 pts: 0.261000 pos: -1 size: 209
ret: 0 st:-1 flags:1 ts:-0.645825
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 208