]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
oggdec:Correct duration
[ffmpeg] / cmdutils.c
index 5ad45e107d708dcb8aec2fe6483862a4e31a9f26..dd19bbffaf40b4c58f76fd2dbcc5b1565b7d7cf5 100644 (file)
@@ -297,6 +297,7 @@ int opt_default(const char *opt, const char *arg){
     int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
     AVCodec *p = NULL;
     AVOutputFormat *oformat = NULL;
+    AVInputFormat *iformat = NULL;
 
     while ((p = av_codec_next(p))) {
         AVClass *c = p->priv_class;
@@ -312,6 +313,13 @@ int opt_default(const char *opt, const char *arg){
     }
     if (oformat)
         goto out;
+    while ((iformat = av_iformat_next(iformat))) {
+        const AVClass *c = iformat->priv_class;
+        if (c && av_find_opt(&c, opt, NULL, 0, 0))
+            break;
+    }
+    if (iformat)
+        goto out;
 
     for(type=0; *avcodec_opts && type<AVMEDIA_TYPE_NB && ret>= 0; type++){
         const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
@@ -415,6 +423,8 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec)
         AVFormatContext *avctx = ctx;
         if (avctx->oformat && avctx->oformat->priv_class) {
             priv_ctx = avctx->priv_data;
+        } else if (avctx->iformat && avctx->iformat->priv_class) {
+            priv_ctx = avctx->priv_data;
         }
     }
 
@@ -897,10 +907,12 @@ int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
 
     memcpy(frame->data,     picref->data,     sizeof(frame->data));
     memcpy(frame->linesize, picref->linesize, sizeof(frame->linesize));
+    frame->pkt_pos          = picref->pos;
     frame->interlaced_frame = picref->video->interlaced;
     frame->top_field_first  = picref->video->top_field_first;
     frame->key_frame        = picref->video->key_frame;
     frame->pict_type        = picref->video->pict_type;
+    frame->sample_aspect_ratio = picref->video->sample_aspect_ratio;
 
     return 1;
 }