Ticket #4851: mythphone_loopback_fix.diff
| File mythphone_loopback_fix.diff, 2.3 KB (added by , 18 years ago) |
|---|
-
mythphone/mythphone/h263.h
65 65 void H263StopDecoder(); 66 66 67 67 private: 68 AVFrame pictureOut, *pictureIn;68 AVFrame *pictureOut, *pictureIn; 69 69 AVCodec *h263Encoder, *h263Decoder; 70 70 AVCodecContext *h263EncContext, *h263DecContext; 71 71 int MaxPostEncodeSize, lastCompressedSize; -
mythphone/mythphone/h263.cpp
52 52 } 53 53 54 54 h263EncContext = avcodec_alloc_context(); 55 pictureOut = avcodec_alloc_frame(); 55 56 56 57 h263EncContext->pix_fmt = PIX_FMT_YUV420P; 57 58 /* put sample parameters */ … … 81 82 MaxPostEncodeSize = 100000; 82 83 PostEncodeFrame = (uchar *)malloc(MaxPostEncodeSize); 83 84 84 pictureOut .linesize[0] = h263EncContext->width;85 pictureOut .linesize[1] = h263EncContext->width / 2;86 pictureOut .linesize[2] = h263EncContext->width / 2;85 pictureOut->linesize[0] = h263EncContext->width; 86 pictureOut->linesize[1] = h263EncContext->width / 2; 87 pictureOut->linesize[2] = h263EncContext->width / 2; 87 88 88 89 return true; 89 90 } … … 117 118 uchar *H263Container::H263EncodeFrame(const uchar *yuvFrame, int *len) 118 119 { 119 120 int size = h263EncContext->width * h263EncContext->height; 120 pictureOut .data[0] = (uchar *)yuvFrame;121 pictureOut .data[1] = pictureOut.data[0] + size;122 pictureOut .data[2] = pictureOut.data[1] + size / 4;121 pictureOut->data[0] = (uchar *)yuvFrame; 122 pictureOut->data[1] = pictureOut->data[0] + size; 123 pictureOut->data[2] = pictureOut->data[1] + size / 4; 123 124 124 *len = lastCompressedSize = avcodec_encode_video(h263EncContext, PostEncodeFrame, MaxPostEncodeSize, &pictureOut);125 *len = lastCompressedSize = avcodec_encode_video(h263EncContext, PostEncodeFrame, MaxPostEncodeSize, pictureOut); 125 126 126 127 return PostEncodeFrame; 127 128 } … … 173 174 av_free(h263EncContext); 174 175 h263EncContext = 0; 175 176 } 177 178 if (pictureOut) 179 av_free(pictureOut); 180 pictureOut = 0; 176 181 } 177 182 178 183 void H263Container::H263StopDecoder()
