]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/nuv.c
Take the target address family in account when determining the family of
[ffmpeg] / libavformat / nuv.c
index eb38d6ffd8544363728268c764524f671581c53d..fe637de6b2e867d0f134cf6405692db836bffdca 100644 (file)
@@ -85,6 +85,8 @@ static int get_codec_data(ByteIOContext *pb, AVStream *vst,
                     vst->codec->codec_tag = get_le32(pb);
                     vst->codec->codec_id =
                         codec_get_id(codec_bmp_tags, vst->codec->codec_tag);
+                    if (vst->codec->codec_tag == MKTAG('R', 'J', 'P', 'G'))
+                        vst->codec->codec_id = CODEC_ID_NUV;
                 } else
                     url_fskip(pb, 4);
 
@@ -149,7 +151,6 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
         vst = av_new_stream(s, ctx->v_id);
         vst->codec->codec_type = CODEC_TYPE_VIDEO;
         vst->codec->codec_id = CODEC_ID_NUV;
-        vst->codec->codec_tag = MKTAG('R', 'J', 'P', 'G');
         vst->codec->width = width;
         vst->codec->height = height;
         vst->codec->bits_per_sample = 10;
@@ -175,7 +176,6 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
 
     get_codec_data(pb, vst, ast, is_mythtv);
     ctx->rtjpg_video = vst->codec->codec_id == CODEC_ID_NUV;
-    ctx->rtjpg_video |= vst->codec->codec_tag == MKTAG('R', 'J', 'P', 'G');
     return 0;
 }