Browse Source

Add -skip_initial_bytes option.

Fixes ticket #1909.
tags/n1.1
Carl Eugen Hoyos 12 years ago
parent
commit
d513fb1c75
3 changed files with 9 additions and 0 deletions
  1. +7
    -0
      libavformat/avformat.h
  2. +1
    -0
      libavformat/options_table.h
  3. +1
    -0
      libavformat/utils.c

+ 7
- 0
libavformat/avformat.h View File

@@ -1162,6 +1162,13 @@ typedef struct AVFormatContext {
*/
enum AVDurationEstimationMethod duration_estimation_method;

/**
* Skip initial bytes when opening stream
* - encoding: unused
* - decoding: Set by user via AVOptions (NO direct access)
*/
unsigned int skip_initial_bytes;

/*****************************************************************
* All fields below this line are not part of the public API. They
* may not be used outside of libavformat and can be changed and


+ 1
- 0
libavformat/options_table.h View File

@@ -72,6 +72,7 @@ static const AVOption options[]={
{"aggressive", "consider things that a sane encoder shouldnt do as an error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, D, "err_detect"},
{"use_wallclock_as_timestamps", "use wallclock as timestamps", OFFSET(use_wallclock_as_timestamps), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D},
{"avoid_negative_ts", "avoid negative timestamps", OFFSET(avoid_negative_ts), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, E},
{"skip_initial_bytes", "skip initial bytes", OFFSET(skip_initial_bytes), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D},
{NULL},
};



+ 1
- 0
libavformat/utils.c View File

@@ -561,6 +561,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma

if ((ret = init_input(s, filename, &tmp)) < 0)
goto fail;
avio_skip(s->pb, s->skip_initial_bytes);

/* check filename in case an image number is expected */
if (s->iformat->flags & AVFMT_NEEDNUMBER) {


Loading…
Cancel
Save