comparison dv.c @ 4520:9bf957e669f0 libavcodec

This fixes error handling for BeOS, removing the need for some ifdefs. AVERROR_ defines are moved to avcodec.h as they are needed in there as well. Feel free to move that to avutil/common.h. Bumped up avcodec/format version numbers as though it's binary compatible we will want to rebuild apps as error values changed. Please from now on use return AVERROR(EFOO) instead of the ugly return -EFOO in your code. This also removes the need for berrno.h.
author mmu_man
date Tue, 13 Feb 2007 18:26:14 +0000
parents 0ee71c12734e
children 5b6f5e7ed3a0
comparison
equal deleted inserted replaced
4519:b08a4d11e01c 4520:9bf957e669f0
123 123
124 done = 1; 124 done = 1;
125 125
126 dv_vlc_map = av_mallocz_static(DV_VLC_MAP_LEV_SIZE*DV_VLC_MAP_RUN_SIZE*sizeof(struct dv_vlc_pair)); 126 dv_vlc_map = av_mallocz_static(DV_VLC_MAP_LEV_SIZE*DV_VLC_MAP_RUN_SIZE*sizeof(struct dv_vlc_pair));
127 if (!dv_vlc_map) 127 if (!dv_vlc_map)
128 return -ENOMEM; 128 return AVERROR(ENOMEM);
129 129
130 /* dv_anchor lets each thread know its Id */ 130 /* dv_anchor lets each thread know its Id */
131 for (i=0; i<DV_ANCHOR_SIZE; i++) 131 for (i=0; i<DV_ANCHOR_SIZE; i++)
132 dv_anchor[i] = (void*)(size_t)i; 132 dv_anchor[i] = (void*)(size_t)i;
133 133
155 init_vlc(&dv_vlc, TEX_VLC_BITS, j, 155 init_vlc(&dv_vlc, TEX_VLC_BITS, j,
156 new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0); 156 new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0);
157 157
158 dv_rl_vlc = av_mallocz_static(dv_vlc.table_size * sizeof(RL_VLC_ELEM)); 158 dv_rl_vlc = av_mallocz_static(dv_vlc.table_size * sizeof(RL_VLC_ELEM));
159 if (!dv_rl_vlc) 159 if (!dv_rl_vlc)
160 return -ENOMEM; 160 return AVERROR(ENOMEM);
161 161
162 for(i = 0; i < dv_vlc.table_size; i++){ 162 for(i = 0; i < dv_vlc.table_size; i++){
163 int code= dv_vlc.table[i][0]; 163 int code= dv_vlc.table[i][0];
164 int len = dv_vlc.table[i][1]; 164 int len = dv_vlc.table[i][1];
165 int level, run; 165 int level, run;