]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - ffmpeg.c
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / ffmpeg.c
index ce366948929db208b34ae13cce0e36fe282fc546..5f407c96cccf52473694360fd0040c8ded61a2c9 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1061,7 +1061,7 @@ static void print_report(AVFormatContext **output_files,
 {
     char buf[1024];
     AVOutputStream *ost;
-    AVFormatContext *oc, *os;
+    AVFormatContext *oc;
     int64_t total_size;
     AVCodecContext *enc;
     int frame_number, vid, i;
@@ -1094,7 +1094,6 @@ static void print_report(AVFormatContext **output_files,
     vid = 0;
     for(i=0;i<nb_ostreams;i++) {
         ost = ost_table[i];
-        os = output_files[ost->file_index];
         enc = ost->st->codec;
         if (vid && enc->codec_type == CODEC_TYPE_VIDEO) {
             snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ",
@@ -1749,6 +1748,8 @@ static int av_encode(AVFormatContext **output_files,
             av_metadata_set(&ost->st->metadata, "language", lang->value);
 
         ost->st->disposition = ist->st->disposition;
+        codec->bits_per_raw_sample= icodec->bits_per_raw_sample;
+        codec->chroma_sample_location = icodec->chroma_sample_location;
 
         if (ost->st->stream_copy) {
             /* if stream_copy is selected, no need to decode or encode */
@@ -1858,6 +1859,7 @@ static int av_encode(AVFormatContext **output_files,
                         av_exit(1);
                     }
                     ost->resample_height = icodec->height - (frame_topBand + frame_bottomBand);
+                    codec->bits_per_raw_sample= 0;
                 }
                 ost->encoding_needed = 1;
                 ist->decoding_needed = 1;
@@ -1973,7 +1975,6 @@ static int av_encode(AVFormatContext **output_files,
     /* init pts */
     for(i=0;i<nb_istreams;i++) {
         ist = ist_table[i];
-        is = input_files[ist->file_index];
         ist->pts = 0;
         ist->next_pts = AV_NOPTS_VALUE;
         ist->is_start = 1;
@@ -2064,7 +2065,6 @@ static int av_encode(AVFormatContext **output_files,
     }
     term_init();
 
-    key = -1;
     timer_start = av_gettime();
 
     for(; received_sigterm == 0;) {
@@ -2338,10 +2338,11 @@ static int opt_me_threshold(const char *opt, const char *arg)
     return 0;
 }
 
-static void opt_loglevel(const char *opt, const char *arg)
+static int opt_loglevel(const char *opt, const char *arg)
 {
     int level = parse_number_or_die(opt, arg, OPT_INT, INT_MIN, INT_MAX);
     av_log_set_level(level);
+    return 0;
 }
 
 static int opt_verbose(const char *opt, const char *arg)
@@ -3215,6 +3216,8 @@ static void new_audio_stream(AVFormatContext *oc)
         audio_enc->channels = audio_channels;
         audio_enc->sample_fmt = audio_sample_fmt;
         audio_enc->channel_layout = channel_layout;
+        if (avcodec_channel_layout_num_channels(channel_layout) != audio_channels)
+            audio_enc->channel_layout = 0;
 
         if(codec && codec->sample_fmts){
             const enum SampleFormat *p= codec->sample_fmts;
@@ -3817,8 +3820,8 @@ static const OptionDef options[] = {
     { "ss", OPT_FUNC2 | HAS_ARG, {(void*)opt_start_time}, "set the start time offset", "time_off" },
     { "itsoffset", OPT_FUNC2 | HAS_ARG, {(void*)opt_input_ts_offset}, "set the input ts offset", "time_off" },
     { "itsscale", HAS_ARG, {(void*)opt_input_ts_scale}, "set the input ts scale", "stream:scale" },
-    { "timestamp", OPT_FUNC2 | HAS_ARG, {(void*)&opt_rec_timestamp}, "set the timestamp ('now' to set the current time)", "time" },
-    { "metadata", OPT_FUNC2 | HAS_ARG, {(void*)&opt_metadata}, "add metadata", "string=string" },
+    { "timestamp", OPT_FUNC2 | HAS_ARG, {(void*)opt_rec_timestamp}, "set the timestamp ('now' to set the current time)", "time" },
+    { "metadata", OPT_FUNC2 | HAS_ARG, {(void*)opt_metadata}, "add metadata", "string=string" },
     { "dframes", OPT_INT | HAS_ARG, {(void*)&max_frames[CODEC_TYPE_DATA]}, "set the number of data frames to record", "number" },
     { "benchmark", OPT_BOOL | OPT_EXPERT, {(void*)&do_benchmark},
       "add timings for benchmarking" },