]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mtv.c
x86: h264qpel: Move stray comment to the right spot and clarify it
[ffmpeg] / libavformat / mtv.c
index 2af9c2dd5669658fa994b04ba3891a5d6b187571..1566faa0863bb1eb36506285dab87146ca343198 100644 (file)
@@ -109,7 +109,7 @@ static int mtv_read_header(AVFormatContext *s)
 
     if (audio_subsegments == 0) {
         av_log_ask_for_sample(s, "MTV files without audio are not supported\n");
-        return AVERROR_INVALIDDATA;
+        return AVERROR_PATCHWELCOME;
     }
 
     mtv->full_segment_size =
@@ -129,8 +129,8 @@ static int mtv_read_header(AVFormatContext *s)
 
     avpriv_set_pts_info(st, 64, 1, mtv->video_fps);
     st->codec->codec_type      = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id        = CODEC_ID_RAWVIDEO;
-    st->codec->pix_fmt         = PIX_FMT_RGB565;
+    st->codec->codec_id        = AV_CODEC_ID_RAWVIDEO;
+    st->codec->pix_fmt         = AV_PIX_FMT_RGB565BE;
     st->codec->width           = mtv->img_width;
     st->codec->height          = mtv->img_height;
     st->codec->sample_rate     = mtv->video_fps;
@@ -145,7 +145,7 @@ static int mtv_read_header(AVFormatContext *s)
 
     avpriv_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE);
     st->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id        = CODEC_ID_MP3;
+    st->codec->codec_id        = AV_CODEC_ID_MP3;
     st->codec->bit_rate        = mtv->audio_br;
     st->need_parsing           = AVSTREAM_PARSE_FULL;
 
@@ -163,9 +163,6 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
     MTVDemuxContext *mtv = s->priv_data;
     AVIOContext *pb = s->pb;
     int ret;
-#if !HAVE_BIGENDIAN
-    int i;
-#endif
 
     if((avio_tell(pb) - s->data_offset + mtv->img_segment_size) % mtv->full_segment_size)
     {
@@ -184,17 +181,6 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
         if(ret < 0)
             return ret;
 
-#if !HAVE_BIGENDIAN
-
-        /* pkt->data is GGGRRRR BBBBBGGG
-         * and we need RRRRRGGG GGGBBBBB
-         * for PIX_FMT_RGB565 so here we
-         * just swap bytes as they come
-         */
-
-        for(i=0;i<mtv->img_segment_size/2;i++)
-            *((uint16_t *)pkt->data+i) = av_bswap16(*((uint16_t *)pkt->data+i));
-#endif
         pkt->stream_index = 0;
     }
 
@@ -202,8 +188,8 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
 }
 
 AVInputFormat ff_mtv_demuxer = {
-    .name           = "MTV",
-    .long_name      = NULL_IF_CONFIG_SMALL("MTV format"),
+    .name           = "mtv",
+    .long_name      = NULL_IF_CONFIG_SMALL("MTV"),
     .priv_data_size = sizeof(MTVDemuxContext),
     .read_probe     = mtv_probe,
     .read_header    = mtv_read_header,