Changeset 235529f2aca9d8ee263d0723792e91d582f1816a
- Timestamp:
- 08/07/08 21:36:48
(5 months ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1215545808 +0000
- git-parent:
[da12022b26ca3f95c4038ceb73926603c27b8f1e]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1215545576 +0000
- Message:
Fixed used of uninitialized memory on unsupported track.
Fixed usage of start_time.
(It should fix #799)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd9330dd |
r235529f |
|
| 201 | 201 | es_format_t fmt; |
|---|
| 202 | 202 | vlc_fourcc_t fcc; |
|---|
| | 203 | const char *psz_type = "unknown"; |
|---|
| 203 | 204 | |
|---|
| 204 | 205 | if( !GetVlcFourcc( cc->codec_id, NULL, &fcc, NULL ) ) |
|---|
| … | … | |
| 222 | 223 | fmt.audio.i_bitspersample = cc->bits_per_sample; |
|---|
| 223 | 224 | fmt.audio.i_blockalign = cc->block_align; |
|---|
| | 225 | psz_type = "audio"; |
|---|
| 224 | 226 | break; |
|---|
| 225 | 227 | case CODEC_TYPE_VIDEO: |
|---|
| … | … | |
| 232 | 234 | *fmt.video.p_palette = *(video_palette_t *)cc->palctrl; |
|---|
| 233 | 235 | } |
|---|
| | 236 | psz_type = "video"; |
|---|
| 234 | 237 | break; |
|---|
| 235 | 238 | case CODEC_TYPE_SUBTITLE: |
|---|
| 236 | 239 | es_format_Init( &fmt, SPU_ES, fcc ); |
|---|
| 237 | | break; |
|---|
| | 240 | psz_type = "subtitle"; |
|---|
| | 241 | break; |
|---|
| | 242 | |
|---|
| 238 | 243 | default: |
|---|
| | 244 | es_format_Init( &fmt, UNKNOWN_ES, 0 ); |
|---|
| | 245 | if( cc->codec_type == CODEC_TYPE_DATA ) |
|---|
| | 246 | psz_type = "data"; |
|---|
| | 247 | else if( cc->codec_type == CODEC_TYPE_ATTACHMENT ) |
|---|
| | 248 | psz_type = "attachment"; |
|---|
| | 249 | |
|---|
| 239 | 250 | msg_Warn( p_demux, "unsupported track type in ffmpeg demux" ); |
|---|
| 240 | 251 | break; |
|---|
| … | … | |
| 247 | 258 | |
|---|
| 248 | 259 | msg_Dbg( p_demux, "adding es: %s codec = %4.4s", |
|---|
| 249 | | cc->codec_type == CODEC_TYPE_AUDIO ? "audio" : "video", |
|---|
| 250 | | (char*)&fcc ); |
|---|
| | 260 | psz_type, (char*)&fcc ); |
|---|
| 251 | 261 | TAB_APPEND( p_sys->i_tk, p_sys->tk, es ); |
|---|
| 252 | 262 | } |
|---|
| … | … | |
| 316 | 326 | |
|---|
| 317 | 327 | i_start_time = ( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE ) ? |
|---|
| 318 | | ( p_sys->ic->start_time / AV_TIME_BASE ) : 0; |
|---|
| | 328 | ( p_sys->ic->start_time * 1000000 / AV_TIME_BASE ) : 0; |
|---|
| 319 | 329 | |
|---|
| 320 | 330 | p_frame->i_dts = ( pkt.dts == (int64_t)AV_NOPTS_VALUE ) ? |
|---|
| 321 | | 0 : (pkt.dts - i_start_time) * 1000000 * |
|---|
| | 331 | 0 : (pkt.dts) * 1000000 * |
|---|
| 322 | 332 | p_sys->ic->streams[pkt.stream_index]->time_base.num / |
|---|
| 323 | | p_sys->ic->streams[pkt.stream_index]->time_base.den; |
|---|
| | 333 | p_sys->ic->streams[pkt.stream_index]->time_base.den - i_start_time; |
|---|
| 324 | 334 | p_frame->i_pts = ( pkt.pts == (int64_t)AV_NOPTS_VALUE ) ? |
|---|
| 325 | | 0 : (pkt.pts - i_start_time) * 1000000 * |
|---|
| | 335 | 0 : (pkt.pts) * 1000000 * |
|---|
| 326 | 336 | p_sys->ic->streams[pkt.stream_index]->time_base.num / |
|---|
| 327 | | p_sys->ic->streams[pkt.stream_index]->time_base.den; |
|---|
| | 337 | p_sys->ic->streams[pkt.stream_index]->time_base.den - i_start_time; |
|---|
| 328 | 338 | |
|---|
| 329 | 339 | #ifdef AVFORMAT_DEBUG |
|---|