36#define SCD_MAGIC ((uint64_t)MKBETAG('S', 'E', 'D', 'B') << 32 | \
37 MKBETAG('S', 'S', 'C', 'F'))
38#define SCD_MIN_HEADER_SIZE 20
39#define SCD_OFFSET_HEADER_SIZE 28
40#define SCD_TRACK_HEADER_SIZE 32
42#define SCD_TRACK_ID_PCM 0
43#define SCD_TRACK_ID_OGG 6
44#define SCD_TRACK_ID_MP3 7
45#define SCD_TRACK_ID_MS_ADPCM 12
106 if ((ret =
avio_read(
s->pb, (
unsigned char*)
table->entries,
table->count *
sizeof(uint32_t))) < 0)
109 for (
size_t i = 0;
i <
table->count;
i++)
113 for (
size_t i = 0;
i <
table->count;
i++)
162 "add '-strict %d' if you want to use it.\n",
167 hoffset =
ctx->hdr.table1.entries[
index];
169 if ((ret =
avio_seek(
s->pb, hoffset, SEEK_SET)) < 0)
260 if (
ctx->hdr.version != 3) {
278 for (
int i = 0;
i <
ctx->hdr.table1.count;
i++) {
283 if (
ctx->hdr.table1.count == 0)
286 if ((ret =
avio_seek(
s->pb,
ctx->tracks[0].absolute_offset, SEEK_SET)) < 0)
298 for (
int i = 0;
i <
ctx->hdr.table1.count;
i++) {
303 ctx->current_track %=
ctx->hdr.table1.count;
305 trk =
ctx->tracks +
ctx->current_track;
306 par =
s->streams[
ctx->current_track]->codecpar;
328 }
else if (ret < 0) {
339 pkt->stream_index =
ctx->current_track;
341 ctx->current_track++;
356 for(
int i = 0;
i <
ctx->hdr.table1.count; ++
i)
357 ctx->tracks[
i].bytes_read = 0;
static AVFormatContext * ctx
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
#define AVERROR_EXPERIMENTAL
Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Utility Preprocessor macros.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
static const uint16_t table[]
#define SCD_TRACK_HEADER_SIZE
#define SCD_TRACK_ID_MS_ADPCM
static int scd_read_header(AVFormatContext *s)
static int scd_read_table(AVFormatContext *s, SCDOffsetTable *table)
static int scd_read_close(AVFormatContext *s)
#define SCD_OFFSET_HEADER_SIZE
static int scd_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
static int scd_read_packet(AVFormatContext *s, AVPacket *pkt)
#define SCD_MIN_HEADER_SIZE
static int scd_read_offsets(AVFormatContext *s)
static int scd_read_track(AVFormatContext *s, SCDTrackHeader *track, int index)
static int scd_probe(const AVProbeData *p)
int nb_channels
Number of channels in this layout.
This struct describes the properties of an encoded stream.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
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.
int index
stream index in AVFormatContext
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
enum AVStreamParseType need_parsing
#define avpriv_request_sample(...)