Revision 93951943

View differences:

libavformat/nut.h
45 45
    FLAG_CODED_PTS  =   8, ///<if set, coded_pts is in the frame header
46 46
    FLAG_STREAM_ID  =  16, ///<if set, stream_id is coded in the frame header
47 47
    FLAG_SIZE_MSB   =  32, ///<if set, data_size_msb is at frame header, otherwise data_size_msb is 0
48
    FLAG_CHECKSUM   =  64, ///<if set then the frame header contains a checksum
48
    FLAG_CHECKSUM   =  64, ///<if set, the frame header contains a checksum
49 49
    FLAG_RESERVED   = 128, ///<if set, reserved_count is coded in the frame header
50
    FLAG_CODED      =4096, ///<if set, coded_flags are stored in the frame header.
51
    FLAG_INVALID    =8192, ///<if set, frame_code is invalid.
50
    FLAG_CODED      =4096, ///<if set, coded_flags are stored in the frame header
51
    FLAG_INVALID    =8192, ///<if set, frame_code is invalid
52 52
}flag_t;
53 53

  
54 54
typedef struct {
libavformat/nutdec.c
142 142
}
143 143

  
144 144
/**
145
 * find the given startcode.
145
 * Find the given startcode.
146 146
 * @param code the startcode
147 147
 * @param pos the start position of the search, or -1 if the current position
148 148
 * @returns the position of the startcode or -1 if not found
......
265 265
    assert(nut->frame_code['N'].flags == FLAG_INVALID);
266 266

  
267 267
    if(skip_reserved(bc, end) || get_checksum(bc)){
268
        av_log(s, AV_LOG_ERROR, "Main header checksum mismatch\n");
268
        av_log(s, AV_LOG_ERROR, "main header checksum mismatch\n");
269 269
        return -1;
270 270
    }
271 271

  
......
319 319
            st->codec->codec_type = CODEC_TYPE_DATA;
320 320
            break;
321 321
        default:
322
            av_log(s, AV_LOG_ERROR, "Unknown stream class (%d)\n", class);
322
            av_log(s, AV_LOG_ERROR, "unknown stream class (%d)\n", class);
323 323
            return -1;
324 324
    }
325 325
    GET_V(stc->time_base_id    , tmp < nut->time_base_count);
326 326
    GET_V(stc->msb_pts_shift   , tmp < 16);
327 327
    stc->max_pts_distance= get_v(bc);
328
    GET_V(stc->decode_delay    , tmp < 1000); //sanity limit, raise this if moors law is true
328
    GET_V(stc->decode_delay    , tmp < 1000); //sanity limit, raise this if Moore's law is true
329 329
    st->codec->has_b_frames= stc->decode_delay;
330 330
    get_v(bc); //stream flags
331 331

  
......
349 349
        GET_V(st->codec->sample_rate , tmp > 0)
350 350
        tmp= get_v(bc); // samplerate_den
351 351
        if(tmp > st->codec->sample_rate){
352
            av_log(s, AV_LOG_ERROR, "bleh, libnut muxed this ;)\n");
352
            av_log(s, AV_LOG_ERROR, "Bleh, libnut muxed this ;)\n");
353 353
            st->codec->sample_rate= tmp;
354 354
        }
355 355
        GET_V(st->codec->channels, tmp > 0)
356 356
    }
357 357
    if(skip_reserved(bc, end) || get_checksum(bc)){
358
        av_log(s, AV_LOG_ERROR, "Stream header %d checksum mismatch\n", stream_id);
358
        av_log(s, AV_LOG_ERROR, "stream header %d checksum mismatch\n", stream_id);
359 359
        return -1;
360 360
    }
361 361
    stc->time_base= &nut->time_base[stc->time_base_id];
......
415 415
    }
416 416

  
417 417
    if(skip_reserved(bc, end) || get_checksum(bc)){
418
        av_log(s, AV_LOG_ERROR, "Info header checksum mismatch\n");
418
        av_log(s, AV_LOG_ERROR, "info header checksum mismatch\n");
419 419
        return -1;
420 420
    }
421 421
    return 0;
......
534 534
    }
535 535

  
536 536
    if(skip_reserved(bc, end) || get_checksum(bc)){
537
        av_log(s, AV_LOG_ERROR, "Index checksum mismatch\n");
537
        av_log(s, AV_LOG_ERROR, "index checksum mismatch\n");
538 538
        return -1;
539 539
    }
540 540
    return 0;
......
554 554
    do{
555 555
        pos= find_startcode(bc, MAIN_STARTCODE, pos)+1;
556 556
        if (pos<0+1){
557
            av_log(s, AV_LOG_ERROR, "no main startcode found\n");
557
            av_log(s, AV_LOG_ERROR, "No main startcode found.\n");
558 558
            return -1;
559 559
        }
560 560
    }while(decode_main_header(nut) < 0);
......
564 564
    for(inited_stream_count=0; inited_stream_count < s->nb_streams;){
565 565
        pos= find_startcode(bc, STREAM_STARTCODE, pos)+1;
566 566
        if (pos<0+1){
567
            av_log(s, AV_LOG_ERROR, "not all stream headers found\n");
567
            av_log(s, AV_LOG_ERROR, "Not all stream headers found.\n");
568 568
            return -1;
569 569
        }
570 570
        if(decode_stream_header(nut) >= 0)
......
610 610
    uint64_t tmp;
611 611

  
612 612
    if(url_ftell(bc) > nut->last_syncpoint_pos + nut->max_distance){
613
        av_log(s, AV_LOG_ERROR, "last frame must have been damaged %"PRId64" > %"PRId64" + %d\n", url_ftell(bc), nut->last_syncpoint_pos, nut->max_distance);
613
        av_log(s, AV_LOG_ERROR, "Last frame must have been damaged %"PRId64" > %"PRId64" + %d\n", url_ftell(bc), nut->last_syncpoint_pos, nut->max_distance);
614 614
        return -1;
615 615
    }
616 616

  
......
762 762
        pos= find_startcode(bc, SYNCPOINT_STARTCODE, pos)+1;
763 763
        if(pos < 1){
764 764
            assert(nut->next_startcode == 0);
765
            av_log(s, AV_LOG_ERROR, "read_timestamp failed\n");
765
            av_log(s, AV_LOG_ERROR, "read_timestamp failed.\n");
766 766
            return AV_NOPTS_VALUE;
767 767
        }
768 768
    }while(decode_syncpoint(nut, &pts, &back_ptr) < 0);
libavformat/nutenc.c
160 160
}
161 161

  
162 162
/**
163
 * stores a string as vb.
163
 * Stores a string as vb.
164 164
 */
165 165
static void put_str(ByteIOContext *bc, const char *string){
166 166
    int len= strlen(string);
......
457 457
    if(pkt->size + 30/*FIXME check*/ + url_ftell(bc) >= nut->last_syncpoint_pos + nut->max_distance)
458 458
        store_sp= 1;
459 459

  
460
//FIXME ensure store_sp is 1 for the first thing
460
//FIXME: Ensure store_sp is 1 in the first place.
461 461

  
462 462
    if(store_sp){
463 463
        syncpoint_t *sp, dummy= {.pos= INT64_MAX};

Also available in: Unified diff