comparison libmpdemux/demux_nuv.c @ 14896:9ddae5897422

Make nuv files work on bigendian (but old nuv files created with mencoder wont play anymore - before they would have worked with mplayer on be)
author reimar
date Thu, 03 Mar 2005 10:19:56 +0000
parents ab5984ab6af0
children cce2717344f4
comparison
equal deleted inserted replaced
14895:7515d2e33076 14896:9ddae5897422
67 67
68 while(current_time < target_time ) 68 while(current_time < target_time )
69 { 69 {
70 if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader)) 70 if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
71 return; /* EOF */ 71 return; /* EOF */
72 le2me_rtframeheader(&rtjpeg_frameheader);
72 73
73 if ( rtjpeg_frameheader.frametype == 'V' ) 74 if ( rtjpeg_frameheader.frametype == 'V' )
74 { 75 {
75 priv->current_position->next = (nuv_position_t*) malloc ( sizeof ( nuv_position_t ) ); 76 priv->current_position->next = (nuv_position_t*) malloc ( sizeof ( nuv_position_t ) );
76 priv->current_position = priv->current_position->next; 77 priv->current_position = priv->current_position->next;
143 int want_audio = (demuxer->audio)&&(demuxer->audio->id!=-2); 144 int want_audio = (demuxer->audio)&&(demuxer->audio->id!=-2);
144 145
145 demuxer->filepos = orig_pos = stream_tell ( demuxer->stream ); 146 demuxer->filepos = orig_pos = stream_tell ( demuxer->stream );
146 if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader)) 147 if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
147 return 0; /* EOF */ 148 return 0; /* EOF */
149 le2me_rtframeheader(&rtjpeg_frameheader);
148 150
149 #if 0 151 #if 0
150 printf("NUV frame: frametype: %c, comptype: %c, packetlength: %d\n", 152 printf("NUV frame: frametype: %c, comptype: %c, packetlength: %d\n",
151 rtjpeg_frameheader.frametype, rtjpeg_frameheader.comptype, 153 rtjpeg_frameheader.frametype, rtjpeg_frameheader.comptype,
152 rtjpeg_frameheader.packetlength); 154 rtjpeg_frameheader.packetlength);
216 /* Go to the start */ 218 /* Go to the start */
217 stream_reset(demuxer->stream); 219 stream_reset(demuxer->stream);
218 stream_seek(demuxer->stream, 0); 220 stream_seek(demuxer->stream, 0);
219 221
220 stream_read ( demuxer->stream, (char*)& rtjpeg_fileheader, sizeof(rtjpeg_fileheader) ); 222 stream_read ( demuxer->stream, (char*)& rtjpeg_fileheader, sizeof(rtjpeg_fileheader) );
223 le2me_rtfileheader(&rtjpeg_fileheader);
221 224
222 /* no video */ 225 /* no video */
223 if (rtjpeg_fileheader.videoblocks == 0) 226 if (rtjpeg_fileheader.videoblocks == 0)
224 { 227 {
225 printf("No video blocks in file\n"); 228 printf("No video blocks in file\n");