comparison libmpdemux/demux_lavf.c @ 31643:33be6a8f9197

Avoid incorrectly duplicating initialization code in new_demux_packet, just use it directly with a size of 0.
author reimar
date Sun, 11 Jul 2010 14:51:51 +0000
parents f15df2e3081b
children 88eef0d997e4
comparison
equal deleted inserted replaced
31642:af4d89e131b4 31643:33be6a8f9197
610 av_free_packet(&pkt); 610 av_free_packet(&pkt);
611 return 1; 611 return 1;
612 } 612 }
613 613
614 if(pkt.destruct == av_destruct_packet && !CONFIG_MEMALIGN_HACK){ 614 if(pkt.destruct == av_destruct_packet && !CONFIG_MEMALIGN_HACK){
615 dp=malloc(sizeof(demux_packet_t)); 615 dp=new_demux_packet(0);
616 dp->len=pkt.size; 616 dp->len=pkt.size;
617 dp->next=NULL;
618 dp->refcount=1;
619 dp->master=NULL;
620 dp->buffer=pkt.data; 617 dp->buffer=pkt.data;
621 dp->stream_pts = MP_NOPTS_VALUE;
622 pkt.destruct= NULL; 618 pkt.destruct= NULL;
623 }else{ 619 }else{
624 dp=new_demux_packet(pkt.size); 620 dp=new_demux_packet(pkt.size);
625 memcpy(dp->buffer, pkt.data, pkt.size); 621 memcpy(dp->buffer, pkt.data, pkt.size);
626 av_free_packet(&pkt); 622 av_free_packet(&pkt);