Merge commit '1a9f9f8' into oldabi

* commit '1a9f9f8': (98 commits)
  Do not drop packets with no valid ->pos set as e.g. DV-in-AVI produces.
  FFMPEG: support demuxer specific options. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  AVIDEC: use_odmc demuxer specific option. (mostly an exmaple for demuxer specific options) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  LAVFAPI: demuxer specific options. (someone please add doxy) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  output_example: use avformat_alloc_output_context() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  LAVFAPI: avformat_alloc_output_context() / simplify usage of muxers. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  LAVF API: remove AVOutputFormat.set_parameters() the field is unused. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  CrystalHD: Add auto-detection of packed b-frame bug.
  lavc: remove disabled avcodec_decode_video() code
  Read the album_artist, grouping and lyrics metadata.
  In libx264 wrapper, change wpredp to a codec specific option.
  AMV: disable DR1 and don't override EMU_EDGE
  lavf: inspect more frames for fps when container time base is coarse
  Fix races in default av_log handler
  flashsv2enc: regression test. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  vorbis: Replace sized int_fast integer types with plain int/unsigned.
  Remove disabled non-optimized code variants.
  bswap.h: Remove disabled code.
  Remove some disabled printf debug cruft.
  Replace more disabled printf() calls by av_dlog().
  ...

Conflicts:
	libavcodec/options.c
	libavcodec/qpeg.c
	libavfilter/avfilter.h
	libavformat/avformat.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2011-05-02 04:18:04 +02:00
100 changed files with 1907 additions and 966 deletions

View File

@@ -496,6 +496,10 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
err = AVERROR(ENOMEM);
goto fail;
}
if (fmt->priv_class) {
*(const AVClass**)ic->priv_data= fmt->priv_class;
av_opt_set_defaults(ic->priv_data);
}
} else {
ic->priv_data = NULL;
}
@@ -504,13 +508,13 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
if (ic->pb)
ff_id3v2_read(ic, ID3v2_DEFAULT_MAGIC);
if (ic->iformat->read_header) {
if (!(ic->flags&AVFMT_FLAG_PRIV_OPT) && ic->iformat->read_header) {
err = ic->iformat->read_header(ic, ap);
if (err < 0)
goto fail;
}
if (pb && !ic->data_offset)
if (!(ic->flags&AVFMT_FLAG_PRIV_OPT) && pb && !ic->data_offset)
ic->data_offset = avio_tell(ic->pb);
#if FF_API_OLD_METADATA
@@ -541,6 +545,22 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
return err;
}
int av_demuxer_open(AVFormatContext *ic, AVFormatParameters *ap){
int err;
if (ic->iformat->read_header) {
err = ic->iformat->read_header(ic, ap);
if (err < 0)
return err;
}
if (ic->pb && !ic->data_offset)
ic->data_offset = avio_tell(ic->pb);
return 0;
}
/** size of probe buffer, for guessing file type from file contents */
#define PROBE_BUF_MIN 2048
#define PROBE_BUF_MAX (1<<20)
@@ -2807,14 +2827,53 @@ int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap)
} else
s->priv_data = NULL;
if (s->oformat->set_parameters) {
ret = s->oformat->set_parameters(s, ap);
if (ret < 0)
return ret;
}
return 0;
}
AVFormatContext *avformat_alloc_output_context(const char *format, AVOutputFormat *oformat, const char *filename){
AVFormatContext *s= avformat_alloc_context();
if(!s)
goto nomem;
if(!oformat){
if (format) {
oformat = av_guess_format(format, NULL, NULL);
if (!oformat) {
av_log(s, AV_LOG_ERROR, "Requested output format '%s' is not a suitable output format\n", format);
goto error;
}
} else {
oformat = av_guess_format(NULL, filename, NULL);
if (!oformat) {
av_log(s, AV_LOG_ERROR, "Unable to find a suitable output format for '%s'\n",
filename);
goto error;
}
}
}
s->oformat= oformat;
if (s->oformat->priv_data_size > 0) {
s->priv_data = av_mallocz(s->oformat->priv_data_size);
if (!s->priv_data)
goto nomem;
if (s->oformat->priv_class) {
*(const AVClass**)s->priv_data= s->oformat->priv_class;
av_opt_set_defaults(s->priv_data);
}
} else
s->priv_data = NULL;
if(filename)
av_strlcpy(s->filename, filename, sizeof(s->filename));
return s;
nomem:
av_log(s, AV_LOG_ERROR, "Out of memory\n");
error:
avformat_free_context(s);
return NULL;
}
static int validate_codec_tag(AVFormatContext *s, AVStream *st)
{
const AVCodecTag *avctag;