24#define SUP_PGS_MAGIC 0x5047
54 pkt->stream_index = 0;
74 unsigned char *buf = p->buf;
75 size_t buf_size = p->buf_size;
78 for (nb_packets = 0; nb_packets < 10; nb_packets++) {
79 size_t full_packet_size;
80 if (buf_size < 10 + 3)
84 full_packet_size =
AV_RB16(buf + 10 + 1) + 10 + 3;
85 if (buf_size < full_packet_size)
87 buf += full_packet_size;
88 buf_size -= full_packet_size;
104 .p.extensions =
"sup",
105 .p.mime_type =
"application/x-pgs",
unsigned int avio_rb16(AVIOContext *s)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rb32(AVIOContext *s)
@ AV_CODEC_ID_HDMV_PGS_SUBTITLE
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int sup_read_packet(AVFormatContext *s, AVPacket *pkt)
static int sup_probe(const AVProbeData *p)
static int sup_read_header(AVFormatContext *s)