summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c4
-rw-r--r--libavcodec/options.c21
2 files changed, 22 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 0919c12b92..b88622d432 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3784,8 +3784,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
init_get_bits(&s->gb, ptr, bit_length);
ff_h264_decode_seq_parameter_set(h);
- if(s->flags& CODEC_FLAG_LOW_DELAY ||
- (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames))
+ if (s->flags& CODEC_FLAG_LOW_DELAY ||
+ (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames))
s->low_delay=1;
if(avctx->has_b_frames < 2)
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 78a7bc8a40..b6ad5d8763 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -37,6 +37,25 @@ static const char* context_to_name(void* ptr) {
return "NULL";
}
+static const AVOption *opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags)
+{
+ AVCodecContext *s = obj;
+ AVCodec *c = NULL;
+
+ if (s->priv_data) {
+ if (s->codec->priv_class)
+ return av_opt_find(s->priv_data, name, unit, opt_flags, search_flags);
+ return NULL;
+ }
+
+ while ((c = av_codec_next(c))) {
+ const AVOption *o;
+ if (c->priv_class && (o = av_opt_find(&c->priv_class, name, unit, opt_flags, search_flags)))
+ return o;
+ }
+ return NULL;
+}
+
#define OFFSET(x) offsetof(AVCodecContext,x)
#define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
//these names are too long to be readable
@@ -457,7 +476,7 @@ static const AVOption options[]={
#undef D
#undef DEFAULT
-static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options, LIBAVUTIL_VERSION_INT, OFFSET(log_level_offset) };
+static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options, LIBAVUTIL_VERSION_INT, OFFSET(log_level_offset), .opt_find = opt_find};
void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
int flags=0;