annotate libmpdemux/demux_nsv.c @ 13690:91faa5745914

consistent I/P/B-frame spelling
author diego
date Tue, 19 Oct 2004 02:09:00 +0000
parents 6f8fe531dd73
children 3042ee91c7dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
1
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
2 /*
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
3 * Nullsoft Streaming Video demuxer
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
4 * for MPlayer
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
5 * by Reza Jelveh <reza.jelveh@tuhh.de>
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
6 * seeking and PCM audio not yet supported
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
7 * PCM needs extra audio chunk "miniheader" parsing
12181
12ddc64011fe Add license, remove bogus comment as told by Reza Jelveh, the author.
diego
parents: 12179
diff changeset
8 * Based on A'rpis G2 work
12ddc64011fe Add license, remove bogus comment as told by Reza Jelveh, the author.
diego
parents: 12179
diff changeset
9 * Licence: GPL
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
10 */
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
11
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
12 #include <stdio.h>
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
13 #include <stdlib.h>
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
14 #include <unistd.h>
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
15
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
16 #include "config.h"
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
17 #include "mp_msg.h"
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
18 #include "help_mp.h"
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
19 #include "stream.h"
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
20 #include "demuxer.h"
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
21 #include "stheader.h"
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
22
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
23 typedef struct {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
24 float v_pts;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
25 int video_pack_no;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
26 unsigned int a_format;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
27 unsigned int v_format;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
28 unsigned char fps;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
29 } nsv_priv_t;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
30
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
31 /**
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
32 * Seeking still to be implemented
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
33 */
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
34 void demux_seek_nsv ( demuxer_t *demuxer, float rel_seek_secs, int flags )
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
35 {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
36 // seeking is not yet implemented
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
37 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
38
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
39
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
40 int demux_nsv_fill_buffer ( demuxer_t *demuxer )
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
41 {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
42 unsigned char hdr[17];
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
43 // for the extra data
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
44 unsigned char aux[6];
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
45 int i_aux = 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
46 // videolen = audio chunk length, audiolen = video chunk length
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
47 int videolen,audiolen;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
48
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
49 sh_video_t *sh_video = demuxer->video->sh;
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
50 sh_audio_t *sh_audio = demuxer->audio->sh;
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
51
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
52 nsv_priv_t * priv = demuxer->priv;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
53
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
54 // if the audio/video chunk has no new header the first 2 bytes will be discarded 0xBEEF
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
55 // or rather 0xEF 0xBE
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
56 stream_read(demuxer->stream,hdr,7);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
57 if(stream_eof(demuxer->stream)) return 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
58 // sometimes instead of 0xBEEF as described for the next audio/video chunk we get
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
59 // a whole new header
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
60
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
61 mp_dbg(MSGT_DEMUX,MSGL_DBG2,"demux_nsv: %08X %08X\n",hdr[0]<<8|hdr[1],stream_tell(demuxer->stream));
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
62 switch(hdr[0]<<8|hdr[1]) {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
63 case 0x4E53:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
64 if(hdr[2]==0x56 && hdr[3]==0x73){
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
65 // NSVs
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
66 // get the header since there is no more metaheader after the first one
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
67 // there is no more need to skip that
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
68 stream_read(demuxer->stream,hdr+7,17-7);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
69 stream_read(demuxer->stream,hdr,7);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
70 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
71 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
72
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
73 case 0xEFBE:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
74 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
75
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
76 default:
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
77 mp_dbg(MSGT_DEMUX,MSGL_WARN,"demux_nsv: sync lost\n");
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
78 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
79 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
80
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
81 if (sh_video)
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
82 sh_video->pts = priv->v_pts =demuxer->video->pts= priv->video_pack_no *
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
83 (float)sh_video->frametime;
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
84 else
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
85 priv->v_pts = priv->video_pack_no;
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
86
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
87 demuxer->filepos=stream_tell(demuxer->stream);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
88
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
89
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
90 mp_dbg(MSGT_DEMUX,MSGL_DBG2,"demux_nsv: %08X: %02X %02X | %02X %02X %02X | %02X %02X \n",
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
91 (int)demuxer->filepos, hdr[0],hdr[1],hdr[2],hdr[3],hdr[4],hdr[5],hdr[6]);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
92
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
93 // read video:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
94 videolen=(hdr[2]>>4)|(hdr[3]<<4)|(hdr[4]<<0xC);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
95 //check if we got extra data like subtitles here
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
96 if( (hdr[2]&0x0f) != 0x0 ) {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
97 stream_read( demuxer->stream, aux, 6);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
98
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
99 i_aux = aux[0]|aux[1]<<8;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
100 // We skip this extra data
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
101 stream_skip( demuxer->stream, i_aux );
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
102 i_aux+=6;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
103 videolen -= i_aux;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
104 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
105
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
106
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
107 // we need to return an empty packet when the
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
108 // video frame is empty otherwise the stream will fasten up
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
109 if(sh_video) {
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
110 if( (hdr[2]&0x0f) != 0x0 )
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
111 ds_read_packet(demuxer->video,demuxer->stream,videolen,priv->v_pts,demuxer->filepos-i_aux,0);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
112 else
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
113 ds_read_packet(demuxer->video,demuxer->stream,videolen,priv->v_pts,demuxer->filepos,0);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
114 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
115 else
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
116 stream_skip(demuxer->stream,videolen);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
117
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
118 // read audio:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
119 audiolen=(hdr[5])|(hdr[6]<<8);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
120 // we need to return an empty packet when the
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
121 // audio frame is empty otherwise the stream will fasten up
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
122 if(sh_audio) {
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
123 ds_read_packet(demuxer->audio,demuxer->stream,audiolen,priv->v_pts,demuxer->filepos+videolen,0);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
124 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
125 else
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
126 stream_skip(demuxer->stream,audiolen);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
127
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
128 ++priv->video_pack_no;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
129
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
130 return 1;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
131
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
132 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
133
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
134
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
135 demuxer_t* demux_open_nsv ( demuxer_t* demuxer )
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
136 {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
137 // last 2 bytes 17 and 18 are unknown but right after that comes the length
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
138 unsigned char hdr[17];
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
139 int videolen,audiolen;
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
140 unsigned char buf[10];
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
141 sh_video_t *sh_video = NULL;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
142 sh_audio_t *sh_audio = NULL;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
143
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
144
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
145 nsv_priv_t * priv = malloc(sizeof(nsv_priv_t));
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
146 demuxer->priv=priv;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
147 priv->video_pack_no=0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
148
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
149 /* disable seeking yet to be fixed*/
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
150 demuxer->seekable = 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
151
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
152 stream_read(demuxer->stream,hdr,4);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
153 if(stream_eof(demuxer->stream)) return 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
154
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
155 /*** if we detected the file to be nsv and there was neither eof nor a header
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
156 **** that means that its most likely a shoutcast stream so we will need to seek
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
157 **** to the first occurance of the NSVs header ****/
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
158 if(!(hdr[0]==0x4E && hdr[1]==0x53 && hdr[2]==0x56)){
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
159 // todo: replace this with a decent string search algo
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
160 while(1){
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
161 stream_read(demuxer->stream,hdr,1);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
162 if(stream_eof(demuxer->stream))
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
163 return 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
164 if(hdr[0]!=0x4E)
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
165 continue;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
166
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
167 stream_read(demuxer->stream,hdr+1,1);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
168
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
169 if(stream_eof(demuxer->stream))
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
170 return 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
171 if(hdr[1]!=0x53)
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
172 continue;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
173
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
174 stream_read(demuxer->stream,hdr+2,1);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
176 if(stream_eof(demuxer->stream))
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
177 return 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
178 if(hdr[2]!=0x56)
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
179 continue;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
180
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
181 stream_read(demuxer->stream,hdr+3,1);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
182
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
183 if(stream_eof(demuxer->stream))
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
184 return 0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
185 if(hdr[3]!=0x73)
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
186 continue;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
187
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
188 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
189 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
190 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
191 if(hdr[0]==0x4E && hdr[1]==0x53 && hdr[2]==0x56){
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
192 // NSV header!
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
193 if(hdr[3]==0x73){
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
194 // NSVs
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
195 stream_read(demuxer->stream,hdr+4,17-4);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
196 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
197
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
198 if(hdr[3]==0x66){
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
199 // NSVf
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
200 int len=stream_read_dword_le(demuxer->stream);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
201 // TODO: parse out metadata!!!!
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
202 stream_skip(demuxer->stream,len-8);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
203
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
204 // NSVs
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
205 stream_read(demuxer->stream,hdr,17);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
206 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
207
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
208 // dummy debug message
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
209 mp_msg(MSGT_DEMUX,MSGL_V,"demux_nsv: Header: %.12s\n",hdr);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
210
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
211 // bytes 8-11 audio codec fourcc
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
212 // PCM fourcc needs extra parsing for every audio chunk, yet to implement
12896
e60cf1255df2 Fix -nosound and -novideo (bug #28)
rtognimp
parents: 12277
diff changeset
213 if((demuxer->audio->id != -2) && strncmp(hdr+8,"NONE", 4)){//&&strncmp(hdr+8,"VLB ", 4)){
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
214 sh_audio = new_sh_audio ( demuxer, 0 );
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
215 demuxer->audio->sh = sh_audio;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
216 sh_audio->format=mmioFOURCC(hdr[8],hdr[9],hdr[10],hdr[11]);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
217 sh_audio->ds = demuxer->audio;
12896
e60cf1255df2 Fix -nosound and -novideo (bug #28)
rtognimp
parents: 12277
diff changeset
218 priv->a_format=mmioFOURCC(hdr[8],hdr[9],hdr[10],hdr[11]);
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
219 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
220
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
221 // store hdr fps
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
222 priv->fps=hdr[16];
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
223
12896
e60cf1255df2 Fix -nosound and -novideo (bug #28)
rtognimp
parents: 12277
diff changeset
224 if ((demuxer->video->id != -2) && strncmp(hdr+4,"NONE", 4)) {
12198
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
225 /* Create a new video stream header */
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
226 sh_video = new_sh_video ( demuxer, 0 );
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
227
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
228 /* Make sure the demuxer knows about the new video stream header
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
229 * (even though new_sh_video() ought to take care of it)
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
230 */
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
231 demuxer->video->sh = sh_video;
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
232
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
233 /* Make sure that the video demuxer stream header knows about its
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
234 * parent video demuxer stream (this is getting wacky), or else
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
235 * video_read_properties() will choke
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
236 */
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
237 sh_video->ds = demuxer->video;
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
238
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
239 // bytes 4-7 video codec fourcc
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
240 priv->v_format = sh_video->format=mmioFOURCC(hdr[4],hdr[5],hdr[6],hdr[7]);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
241
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
242 // new video stream! parse header
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
243 sh_video->disp_w=hdr[12]|(hdr[13]<<8);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
244 sh_video->disp_h=hdr[14]|(hdr[15]<<8);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
245 sh_video->bih=(BITMAPINFOHEADER*)calloc(1,sizeof(BITMAPINFOHEADER));
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
246 sh_video->bih->biSize=sizeof(BITMAPINFOHEADER);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
247 sh_video->bih->biPlanes=1;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
248 sh_video->bih->biBitCount=24;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
249 sh_video->bih->biWidth=hdr[12]|(hdr[13]<<8);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
250 sh_video->bih->biHeight=hdr[14]|(hdr[15]<<8);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
251 memcpy(&sh_video->bih->biCompression,hdr+4,4);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
252 sh_video->bih->biSizeImage=sh_video->bih->biWidth*sh_video->bih->biHeight*3;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
253
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
254 // here we search for the correct keyframe
12275
3bd70d9bebb7 Fix VP62 keyframe search
rtognimp
parents: 12272
diff changeset
255 // vp6 keyframe is when the 2nd byte of the vp6 header is
3bd70d9bebb7 Fix VP62 keyframe search
rtognimp
parents: 12272
diff changeset
256 // 0x36 for VP61 and 0x46 for VP62
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
257 if((priv->v_format==mmioFOURCC('V','P','6','1')) ||
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
258 (priv->v_format==mmioFOURCC('V','P','6','2')) ||
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
259 (priv->v_format==mmioFOURCC('V','P','3','1'))) {
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
260 stream_read(demuxer->stream,buf,10);
12277
ad3a4af318f2 More keyframe search fix for VP6x
rtognimp
parents: 12275
diff changeset
261 if (((((priv->v_format>>16) & 0xff) == '6') && ((buf[8]&0x0e)!=0x06)) ||
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
262 ((((priv->v_format>>16) & 0xff) == '3') && (buf[8]!=0x00 || buf[9]!=0x08))) {
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
263 mp_msg(MSGT_DEMUX,MSGL_V,"demux_nsv: searching %.4s keyframe...\n", (char*)&priv->v_format);
12277
ad3a4af318f2 More keyframe search fix for VP6x
rtognimp
parents: 12275
diff changeset
264 while(((((priv->v_format>>16) & 0xff) == '6') && ((buf[8]&0x0e)!=0x06)) ||
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
265 ((((priv->v_format>>16) & 0xff) == '3') && (buf[8]!=0x00 || buf[9]!=0x08))){
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
266 mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_nsv: %.4s block skip.\n", (char*)&priv->v_format);
12179
aeb377ccb110 Fix vp61 keyframe search (do not skip blocks if 1st frame is keyframe)
rtognimp
parents: 12175
diff changeset
267 videolen=(buf[2]>>4)|(buf[3]<<4)|(buf[4]<<0xC);
aeb377ccb110 Fix vp61 keyframe search (do not skip blocks if 1st frame is keyframe)
rtognimp
parents: 12175
diff changeset
268 audiolen=(buf[5])|(buf[6]<<8);
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
269 stream_skip(demuxer->stream, videolen+audiolen-3);
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
270 stream_read(demuxer->stream,buf,10);
12277
ad3a4af318f2 More keyframe search fix for VP6x
rtognimp
parents: 12275
diff changeset
271 if(stream_eof(demuxer->stream)) return 0;
12179
aeb377ccb110 Fix vp61 keyframe search (do not skip blocks if 1st frame is keyframe)
rtognimp
parents: 12175
diff changeset
272 if(buf[0]==0x4E){
aeb377ccb110 Fix vp61 keyframe search (do not skip blocks if 1st frame is keyframe)
rtognimp
parents: 12175
diff changeset
273 mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_nsv: Got NSVs block.\n");
12272
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
274 stream_skip(demuxer->stream,7);
369073d0f143 Fix support for audio only streams
rtognimp
parents: 12198
diff changeset
275 stream_read(demuxer->stream,buf,10);
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
276 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
277 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
278 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
279
13299
6f8fe531dd73 avoid always skipping first junk with a "sync lost" message
reimar
parents: 12896
diff changeset
280 // data starts 10 bytes before current pos but later
6f8fe531dd73 avoid always skipping first junk with a "sync lost" message
reimar
parents: 12896
diff changeset
281 // we seek 17 backwards
6f8fe531dd73 avoid always skipping first junk with a "sync lost" message
reimar
parents: 12896
diff changeset
282 stream_skip(demuxer->stream,7);
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
283 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
284
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
285 switch(priv->fps){
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
286 case 0x80:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
287 sh_video->fps=30;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
288 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
289 case 0x81:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
290 sh_video->fps=(float)30000.0/1001.0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
291 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
292 case 0x82:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
293 sh_video->fps=25;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
294 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
295 case 0x83:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
296 sh_video->fps=(float)24000.0/1001.0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
297 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
298 case 0x85:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
299 sh_video->fps=(float)15000.0/1001.0;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
300 break;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
301 default:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
302 sh_video->fps = (float)priv->fps;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
303 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
304 sh_video->frametime = (float)1.0 / (float)sh_video->fps;
12198
759b010d6c09 Do not crash on audio only streams
rtognimp
parents: 12181
diff changeset
305 }
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
306 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
307
13299
6f8fe531dd73 avoid always skipping first junk with a "sync lost" message
reimar
parents: 12896
diff changeset
308 // seek to start of NSV header
6f8fe531dd73 avoid always skipping first junk with a "sync lost" message
reimar
parents: 12896
diff changeset
309 stream_seek(demuxer->stream,stream_tell(demuxer->stream)-17);
12175
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
310
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
311 return demuxer;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
312 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
313
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
314 int nsv_check_file ( demuxer_t* demuxer )
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
315 {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
316 unsigned int id;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
317
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
318 /* Store original position */
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
319 // off_t orig_pos = stream_tell(demuxer->stream);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
320
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
321 mp_msg ( MSGT_DEMUX, MSGL_V, "Checking for Nullsoft Streaming Video\n" );
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
322
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
323 //---- check NSVx header:
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
324 id=stream_read_dword_le(demuxer->stream);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
325 if(id!=mmioFOURCC('N','S','V','f') && id!=mmioFOURCC('N','S','V','s'))
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
326 return 0; // not an NSV file
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
327
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
328 stream_reset(demuxer->stream); // clear EOF
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
329 stream_seek(demuxer->stream,demuxer->stream->start_pos);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
330
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
331
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
332 return 1;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
333 }
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
334
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
335 void demux_close_nsv(demuxer_t* demuxer) {
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
336 nsv_priv_t* priv = demuxer->priv;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
337
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
338 if(!priv)
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
339 return;
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
340 free(priv);
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
341
da8e39bfe121 nsv (Nullsoft streaming video) demuxer
rtognimp
parents:
diff changeset
342 }