diff options
author | wm4 <wm4@nowhere> | 2013-05-29 14:54:44 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-29 14:57:05 +0200 |
commit | fa75ae96e1b2bc0d689a957d4c522002965c4eb2 (patch) | |
tree | c15b76c63fc3091c48ca6657afefe07cfd7f57b2 /demux | |
parent | a21cfddaabd84589b6cfc9a363a4e282575016b9 (diff) | |
download | mpv-fa75ae96e1b2bc0d689a957d4c522002965c4eb2.tar.bz2 mpv-fa75ae96e1b2bc0d689a957d4c522002965c4eb2.tar.xz |
demux_asf: fix after commit 5165e19
This demuxer reallocated packets on its own, instead of using the
demux.c functions, which clashed with a recent change.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux.c | 3 | ||||
-rw-r--r-- | demux/demux_asf.c | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/demux/demux.c b/demux/demux.c index c379ee4736..856951f905 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -742,8 +742,7 @@ void ds_free_packs(demux_stream_t *ds) } if (ds->asf_packet) { // free unfinished .asf fragments: - free(ds->asf_packet->buffer); - free(ds->asf_packet); + free_demux_packet(ds->asf_packet); ds->asf_packet = NULL; } ds->first = ds->last = NULL; diff --git a/demux/demux_asf.c b/demux/demux_asf.c index 1d181eac67..0b8da6930f 100644 --- a/demux/demux_asf.c +++ b/demux/demux_asf.c @@ -100,11 +100,9 @@ static void init_priv (struct asf_priv* asf){ static void demux_asf_append_to_packet(demux_packet_t* dp,unsigned char *data,int len,int offs) { if(dp->len!=offs && offs!=-1) mp_msg(MSGT_DEMUX,MSGL_V,"warning! fragment.len=%d BUT next fragment offset=%d \n",dp->len,offs); - dp->buffer=realloc(dp->buffer,dp->len+len+MP_INPUT_BUFFER_PADDING_SIZE); - memcpy(dp->buffer+dp->len,data,len); - memset(dp->buffer+dp->len+len, 0, MP_INPUT_BUFFER_PADDING_SIZE); - mp_dbg(MSGT_DEMUX,MSGL_DBG4,"data appended! %d+%d\n",dp->len,len); - dp->len+=len; + size_t old_len = dp->len; + resize_demux_packet(dp, dp->len + len); + memcpy(dp->buffer + old_len, data, len); } static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,int id,int seq,uint64_t time,unsigned short dur,int offs,int keyframe){ |