libmpcdec: src/streaminfo.c File Reference

Main Page | Class List | Directories | File List | Class Members | File Members | Related Pages

# streaminfo.c File Reference

`#include <mpcdec/mpcdec.h>`
`#include <mpcdec/internal.h>`

Go to the source code of this file.

## Functions

void | mpc_streaminfo_init (mpc_streaminfo *si)
mpc_int32_t | mpc_streaminfo_read (mpc_streaminfo *si, mpc_reader *r)
double | mpc_streaminfo_get_length (mpc_streaminfo *si)
mpc_int64_t | mpc_streaminfo_get_length_samples (mpc_streaminfo *si)

## Detailed Description

Implementation of streaminfo reading functions.

Definition in file streaminfo.c.

## Function Documentation

double mpc_streaminfo_get_length | ( | mpc_streaminfo * | si | ) |

Gets length of stream si, in seconds.

Returns:
  length of stream in seconds

Definition at line 265 of file streaminfo.c.

References mpc_streaminfo_get_length_samples().

mpc_int64_t mpc_streaminfo_get_length_samples | ( | mpc_streaminfo * | si | ) |

Returns length of stream si, in samples.

Returns:
  length of stream in samples

Definition at line 272 of file streaminfo.c.

References mpc_streaminfo::frames, mpc_streaminfo::is_true_gapless, and mpc_streaminfo::last_frame_samples.

Referenced by mpc_streaminfo_get_length().

void mpc_streaminfo_init | ( | mpc_streaminfo * | si | ) |

Initializes a streaminfo structure.

Parameters:

  | si | streaminfo structure to initialize

Definition at line 56 of file streaminfo.c.

mpc_int32_t mpc_streaminfo_read | ( | mpc_streaminfo * | si,
|  | mpc_reader * | r
| ) |

Reads streaminfo header from the mpc stream supplied by r.

Parameters:

  | si | streaminfo pointer to which info will be written
  | r | stream reader to supply raw data

Returns:
  error code

Definition at line 204 of file streaminfo.c.

References mpc_streaminfo::average_bitrate, mpc_reader_t::data, ERROR_CODE_FILE, mpc_streaminfo::frames, mpc_reader_t::get_size, mpc_streaminfo::header_position, JumpID3v2(), mpc_streaminfo::pcm_samples, mpc_reader_t::read, mpc_streaminfo::sample_freq, mpc_reader_t::seek, mpc_streaminfo::stream_version, mpc_streaminfo::tag_offset, and mpc_streaminfo::total_file_length.