Mercurial > mplayer.hg
view network.h @ 1306:7ce37211e454
yuv2rgb_mmx crashes with ffdivx codec, when we play back avi files that have
a frame width that is not an exact multiple of 8.
Testcase: 405.avi (356x240). Playing on an MMX capable x86 system using the
x11 video-out driver results in a segfault.
The MMX routines convert image data in quantities of 8 pixels in each loop,
and the inner loop was not terminated in case there are only 1-7 pixels left,
producing too much RGB output.
For now, just ignore the last few pixels on each row, to avoid the segfaults.
(Gives a black vertical border on the right, if you play a video with
width%8 != 0) A possible future enhancement would be, to add a second loop
to convert the last width%8 pixels to RGB using a byte loop.
author | jkeil |
---|---|
date | Thu, 12 Jul 2001 15:23:26 +0000 |
parents | 92833c9472e8 |
children |
line wrap: on
line source
/* * Network layer for MPlayer * by Bertrand BAUDET <bertrand_baudet@yahoo.com> * (C) 2001, MPlayer team. */ #ifndef __NETWORK_H #define __NETWORK_H #include <pthread.h> #include "stream.h" #include "url.h" #define BUFFER_SIZE 2048 typedef enum { streaming_stopped_e, streaming_playing_e } streaming_status; typedef struct { char *buffer; int length; } Net_Fifo; typedef struct streaming_control { URL_t **url; int fd_net; int fd_pipe_in; streaming_status status; pthread_t thread_id; Net_Fifo *buffer; int buffering; // boolean int prebuffer_size; int (*streaming_read)( struct streaming_control *stream_ctrl ); } streaming_ctrl_t; Net_Fifo* net_fifo_new( ); void net_fifo_free(Net_Fifo *net_fifo ); int net_fifo_pop(Net_Fifo *net_fifo, char *buffer, int length ); int net_fifo_push(Net_Fifo *net_fifo, char *buffer, int length ); int connect2Server(char *host, int port); int readFromServer(int fd, char *buffer, int length ); int autodetectProtocol( URL_t *url, int *fd_out ); #endif