Revision d5f60f90 streaming.c

View differences:

streaming.c
27 27
#include <chunkiser_attrib.h>
28 28

  
29 29
#include "streaming.h"
30
#include "streamer.h"
30 31
#include "output.h"
31 32
#include "input.h"
32 33
#include "dbg.h"
......
552 553

  
553 554
static struct chunkID_set * compose_offer_cset(void)
554 555
{
555
  return cb_to_bmap(cb);
556
  if (am_i_source()) {
557
    struct chunk *chunks;
558
    int num_chunks, j;
559
    struct chunkID_set *my_bmap = chunkID_set_init("type=bitmap");
560
    chunks = cb_get_chunks(cb, &num_chunks);
561
    for(j=((num_chunks-1)*3)/4; j>=0; j--) {
562
      chunkID_set_add_chunk(my_bmap, chunks[j].id);
563
    }
564
    return my_bmap;
565
  } else {
566
    return cb_to_bmap(cb);
567
  }
556 568
}
557 569

  
558 570

  

Also available in: Unified diff