Mercurial > libavformat.hg
comparison swfenc.c @ 5910:536e5527c1e0 libavformat
Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.
author | stefano |
---|---|
date | Tue, 30 Mar 2010 23:30:55 +0000 |
parents | 33a244b7ca65 |
children |
comparison
equal
deleted
inserted
replaced
5909:b8041f85c327 | 5910:536e5527c1e0 |
---|---|
183 swf->swf_frame_number = 0; | 183 swf->swf_frame_number = 0; |
184 swf->video_frame_number = 0; | 184 swf->video_frame_number = 0; |
185 | 185 |
186 for(i=0;i<s->nb_streams;i++) { | 186 for(i=0;i<s->nb_streams;i++) { |
187 AVCodecContext *enc = s->streams[i]->codec; | 187 AVCodecContext *enc = s->streams[i]->codec; |
188 if (enc->codec_type == CODEC_TYPE_AUDIO) { | 188 if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
189 if (enc->codec_id == CODEC_ID_MP3) { | 189 if (enc->codec_id == CODEC_ID_MP3) { |
190 if (!enc->frame_size) { | 190 if (!enc->frame_size) { |
191 av_log(s, AV_LOG_ERROR, "audio frame size not set\n"); | 191 av_log(s, AV_LOG_ERROR, "audio frame size not set\n"); |
192 return -1; | 192 return -1; |
193 } | 193 } |
462 } | 462 } |
463 | 463 |
464 static int swf_write_packet(AVFormatContext *s, AVPacket *pkt) | 464 static int swf_write_packet(AVFormatContext *s, AVPacket *pkt) |
465 { | 465 { |
466 AVCodecContext *codec = s->streams[pkt->stream_index]->codec; | 466 AVCodecContext *codec = s->streams[pkt->stream_index]->codec; |
467 if (codec->codec_type == CODEC_TYPE_AUDIO) | 467 if (codec->codec_type == AVMEDIA_TYPE_AUDIO) |
468 return swf_write_audio(s, codec, pkt->data, pkt->size); | 468 return swf_write_audio(s, codec, pkt->data, pkt->size); |
469 else | 469 else |
470 return swf_write_video(s, codec, pkt->data, pkt->size); | 470 return swf_write_video(s, codec, pkt->data, pkt->size); |
471 } | 471 } |
472 | 472 |
478 int file_size, i; | 478 int file_size, i; |
479 | 479 |
480 video_enc = NULL; | 480 video_enc = NULL; |
481 for(i=0;i<s->nb_streams;i++) { | 481 for(i=0;i<s->nb_streams;i++) { |
482 enc = s->streams[i]->codec; | 482 enc = s->streams[i]->codec; |
483 if (enc->codec_type == CODEC_TYPE_VIDEO) | 483 if (enc->codec_type == AVMEDIA_TYPE_VIDEO) |
484 video_enc = enc; | 484 video_enc = enc; |
485 else | 485 else |
486 av_fifo_free(swf->audio_fifo); | 486 av_fifo_free(swf->audio_fifo); |
487 } | 487 } |
488 | 488 |