Revision c5e1e982

View differences:

ffmpeg.c
2104 2104
        ist->is_start = 1;
2105 2105
    }
2106 2106

  
2107
    /* set the duration of the output to the duration of the input
2108
     * if the output ends up being different, it'll be corrected later */
2109
    for (i=0;i<nb_output_files;i++) {
2110
        AVFormatContext *out_file = output_files[i];
2111
        AVFormatContext *in_file = input_files[i];
2112

  
2113
        if (recording_time != INT64_MAX) {
2114
            out_file->duration = recording_time / 1000000 * AV_TIME_BASE;
2115
        } else {
2116
            out_file->duration = in_file->duration;
2117
        }
2118
    }
2119

  
2107 2120
    /* set meta data information from input file if required */
2108 2121
    for (i=0;i<nb_meta_data_maps;i++) {
2109 2122
        AVFormatContext *out_file;
libavformat/flvenc.c
221 221

  
222 222
    put_amf_string(pb, "duration");
223 223
    flv->duration_offset= url_ftell(pb);
224
    put_amf_double(pb, 0); // delayed write
224
    put_amf_double(pb, s->duration / AV_TIME_BASE); // fill in the guessed duration, it'll be corrected later if incorrect
225 225

  
226 226
    if(video_enc){
227 227
        put_amf_string(pb, "width");

Also available in: Unified diff