Mercurial > libavformat.hg
comparison mpegts.c @ 2126:d21480a68906 libavformat
Indentation
author | benoit |
---|---|
date | Mon, 04 Jun 2007 08:53:08 +0000 |
parents | eb0513a0c1b6 |
children | e70e06400158 |
comparison
equal
deleted
inserted
replaced
2125:f7253362df84 | 2126:d21480a68906 |
---|---|
1211 ts->auto_guess = 0; | 1211 ts->auto_guess = 0; |
1212 | 1212 |
1213 if (s->iformat == &mpegts_demuxer) { | 1213 if (s->iformat == &mpegts_demuxer) { |
1214 /* normal demux */ | 1214 /* normal demux */ |
1215 | 1215 |
1216 /* first do a scaning to get all the services */ | 1216 /* first do a scaning to get all the services */ |
1217 url_fseek(pb, pos, SEEK_SET); | |
1218 mpegts_scan_sdt(ts); | |
1219 | |
1220 handle_packets(ts, s->probesize); | |
1221 | |
1222 if (ts->nb_services <= 0) { | |
1223 /* no SDT found, we try to look at the PAT */ | |
1224 | |
1225 /* First remove the SDT filters from each PID */ | |
1226 int i; | |
1227 for (i=0; i < NB_PID_MAX; i++) { | |
1228 if (ts->pids[i]) | |
1229 mpegts_close_filter(ts, ts->pids[i]); | |
1230 } | |
1217 url_fseek(pb, pos, SEEK_SET); | 1231 url_fseek(pb, pos, SEEK_SET); |
1218 mpegts_scan_sdt(ts); | 1232 mpegts_scan_pat(ts); |
1219 | 1233 |
1220 handle_packets(ts, s->probesize); | 1234 handle_packets(ts, s->probesize); |
1221 | 1235 } |
1222 if (ts->nb_services <= 0) { | 1236 |
1223 /* no SDT found, we try to look at the PAT */ | 1237 if (ts->nb_services <= 0) { |
1224 | 1238 /* raw transport stream */ |
1225 /* First remove the SDT filters from each PID */ | 1239 ts->auto_guess = 1; |
1226 int i; | 1240 s->ctx_flags |= AVFMTCTX_NOHEADER; |
1227 for (i=0; i < NB_PID_MAX; i++) { | 1241 goto do_pcr; |
1228 if (ts->pids[i]) | 1242 } |
1229 mpegts_close_filter(ts, ts->pids[i]); | 1243 |
1230 } | 1244 /* tune to first service found */ |
1231 url_fseek(pb, pos, SEEK_SET); | 1245 for(i=0; i<ts->nb_services; i++){ |
1232 mpegts_scan_pat(ts); | 1246 service = ts->services[i]; |
1233 | 1247 sid = service->sid; |
1234 handle_packets(ts, s->probesize); | |
1235 } | |
1236 | |
1237 if (ts->nb_services <= 0) { | |
1238 /* raw transport stream */ | |
1239 ts->auto_guess = 1; | |
1240 s->ctx_flags |= AVFMTCTX_NOHEADER; | |
1241 goto do_pcr; | |
1242 } | |
1243 | |
1244 /* tune to first service found */ | |
1245 for(i=0; i<ts->nb_services; i++){ | |
1246 service = ts->services[i]; | |
1247 sid = service->sid; | |
1248 #ifdef DEBUG_SI | 1248 #ifdef DEBUG_SI |
1249 av_log(ts->stream, AV_LOG_DEBUG, "tuning to '%s'\n", service->name); | 1249 av_log(ts->stream, AV_LOG_DEBUG, "tuning to '%s'\n", service->name); |
1250 #endif | 1250 #endif |
1251 | 1251 |
1252 /* now find the info for the first service if we found any, | 1252 /* now find the info for the first service if we found any, |
1253 otherwise try to filter all PATs */ | 1253 otherwise try to filter all PATs */ |
1254 | 1254 |
1255 url_fseek(pb, pos, SEEK_SET); | 1255 url_fseek(pb, pos, SEEK_SET); |
1256 mpegts_set_service(ts, sid); | 1256 mpegts_set_service(ts, sid); |
1257 | 1257 |
1258 handle_packets(ts, s->probesize); | 1258 handle_packets(ts, s->probesize); |
1259 } | 1259 } |
1260 /* if could not find service, enable auto_guess */ | 1260 /* if could not find service, enable auto_guess */ |
1261 | 1261 |
1262 ts->auto_guess = 1; | 1262 ts->auto_guess = 1; |
1263 | 1263 |
1264 #ifdef DEBUG_SI | 1264 #ifdef DEBUG_SI |
1265 av_log(ts->stream, AV_LOG_DEBUG, "tuning done\n"); | 1265 av_log(ts->stream, AV_LOG_DEBUG, "tuning done\n"); |
1266 #endif | 1266 #endif |
1267 s->ctx_flags |= AVFMTCTX_NOHEADER; | 1267 s->ctx_flags |= AVFMTCTX_NOHEADER; |
1268 } else { | 1268 } else { |
1269 AVStream *st; | 1269 AVStream *st; |
1270 int pcr_pid, pid, nb_packets, nb_pcrs, ret, pcr_l; | 1270 int pcr_pid, pid, nb_packets, nb_pcrs, ret, pcr_l; |